1. RE: Mathew's interpreter
- Posted by Matthew Lewis <matthewwalkerlewis at YAHOO.COM> Jul 30, 2002
- 380 views
> -----Original Message----- > From: Kat [mailto:gertie at PELL.NET] > Say, Mathew,, can the routine_id()s for vars in your > interpreter be *assigned* > or just looked up? I'm not sure what you mean. You have no control over what the actual id for any variable is. The working of variable_id is almost identical to routine_id. Any variable in scope when variable_id is called should return a valid variable_id. You can, however, *create* variables on the fly. In fact, you can create a variable, and then refer to it directly: -- silly example... include variable.em integer foo_id foo_id = create_variable( "foo", TYPE_SEQUENCE, "bar") puts(1, foo ) write_variable( foo_id, "\n") puts(1, read_variable( foo_id) ) I hope this answers your question. Matt Lewis
2. RE: Mathew's interpreter
- Posted by Kat <gertie at PELL.NET> Jul 30, 2002
- 383 views
On 30 Jul 2002, at 7:13, Matthew Lewis wrote: > > > > -----Original Message----- > > From: Kat [mailto:gertie at PELL.NET] > > > Say, Mathew,, can the routine_id()s for vars in your > > interpreter be *assigned* > > or just looked up? > > I'm not sure what you mean. You have no control over what the actual id for > any > variable is. The working of variable_id is almost identical to routine_id. > Any > variable in scope when variable_id is called should return a valid > variable_id. > > You can, however, *create* variables on the fly. In fact, you can create a > variable, and then refer to it directly: > > -- silly example... > include variable.em > integer foo_id > foo_id = create_variable( "foo", TYPE_SEQUENCE, "bar") > puts(1, foo ) > write_variable( foo_id, "\n") > puts(1, read_variable( foo_id) ) > > I hope this answers your question. Yes, thanks. What's it's scope? Kat
3. RE: Mathew's interpreter
- Posted by Matthew Lewis <matthewwalkerlewis at YAHOO.COM> Jul 30, 2002
- 382 views
> -----Original Message----- > From: Kat [mailto:gertie at PELL.NET] > > -- silly example... > > include variable.em > > integer foo_id > > foo_id = create_variable( "foo", TYPE_SEQUENCE, "bar") > > puts(1, foo ) > > write_variable( foo_id, "\n") > > puts(1, read_variable( foo_id) ) > > > > I hope this answers your question. > > Yes, thanks. What's it's scope? create_variable() always creates a global variable. Matt Lewis