1. The complexity of double pass interpreter
- Posted by achury Apr 21, 2021
- 1239 views
I found this text:
It remembers me that Rob Craig allways said that interpreter must to do a single reading pass on the source file and that procedures must to be declared prior to called. A more flexible programming style involves more complexity layers on the interpreter (and longer execution times)
Marco A
2. Re: The complexity of double pass interpreter
- Posted by ChrisB (moderator) Apr 21, 2021
- 1241 views
Hi
Both Eu and Phix can call procedures and functions declared after being called. It is just habit that I always declare them first. Some other languages require name declaration before use, but then allow the actual function/procedure to be written later on in the program.
Function/procedure namespaces in includes (IMHO) confuse the issue, because, as I see it, Eu has a 'sideways' include system, whereas Phix has a 'flat file' system.
I'm sure that I could write a demo to demonstrate this, but it has been done adequately before elsewhere. There are good reasons for both, I just prefer one.
By the way, I've just solved the SDL2 screenshot method - I'm so proud right now.
Cheers
Chris