Re: Forward referencing

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

ChrisBurch2 wrote:
> 
> Hi
> 
> I've just a forum search for 'forward reference' Sorry, looks like
> a got hornets nest, and may be too much trouble to re write the interpreter.
> 
> However, I'm still interested as to why allowing forward refs would
> introduce bugs.
> 
> Is this not a simplistic view of how an eu progrom is interpreted.
> 
> 1. stretch out all the files (includes etc) into one long program
> 2. build a table with all the variables (globals and locals) and functions
> and procedures.
> 3. run the program with the addresses of the functions referenced
> from the name table
> 
> if so, why not allow references to funcs and procedures that occur
> later in the program list?
> 
> Chris

Probably because of he various checks to be performed on exiting a file and on
completing parsing. That was the hardest part in implementing it.

routine_id(unheard_of_routine) should return -1, no problem with that either.

Perhaps it is the fright of and recoiling at... yes, spaghetti phantoms in the
code. I've never seen such coding, but perhaps I'm just too young.

CChris

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

Search



Quick Links

User menu

Not signed in.

Misc Menu