Re: Thoughts on eval()

new topic     » goto parent     » topic index » view thread      » older message » newer message

Jason Gade wrote:
> 
> Matt Lewis wrote:
> > If you examine how the interpreter does things, there's really no difference
> > between 'Code' space and variable space.  SubPrograms (including one for
> > TopLevel) contain a code section.  The CurrentSub is constantly changed,
> > so that the interpreter executes code from different places all the time.
> 
> Okay.  I didn't quite get that far.  From what I could see is that all the
> parsed IL
> code went into the Code[] sequence.  Names of functions in SymTab[][] had a
> field that
> pointed to the proper place in the Code[] sequence.  I still don't have a full
> understanding
> of it, though.

Okay, I see now that code for subprograms is stored in SymTab[x][S_CODE] right?

So what I'm saying is that func() or proc() would add an entry to SymTab with
the proper code and return a routine id that could be used to call it.  I haven't
checked out the routine_id code yet.

I think you are saying that eval() would execute in place as if the statements
were in the top level?

=====================================
Too many freaks, not enough circuses.

j.

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu