Re: Bind features
- Posted by Robert Craig <rds at ATTCANADA.NET> Jul 01, 1999
- 630 views
Ralf writes: > Robert Craig writes: >> 1. After processing a constant declaration, all the data and >> code used in calculating the constants value is freed. e.g. >> >> constant SIZE=10+100-22*foobar({1,2,3,4,5}) > Robert, wouldn't you above example, not generate 1) the four > bytes needed to store the value *and* 2) the fourthy two bytes > to store the code that calculates the constant. No, the code is generated, executed, and then discarded, since it will never have to be executed again. The same is true for all "top-level" code. (I'm not sure where you got the value "42" - wasn't that the answer to the "meaning of life" in some Monty Python movie?) > I mean: > constant my_string = "Hello, world" > Is in the code, in the memory of the interpreter, even before > it is executed. Therefor it is in memory twice, unlike > information loaded from a resource file. Euphoria reads the source statement from your .ex file, makes an internal sequence for "Hello, world", assigns it to my_string, and then the source statement and any code are discarded, leaving just my_string pointing to a single copy of "Hello, world". If you specify "with trace", then Euphoria will retain the source statements in memory, so you can see them on the trace screen, but normally each line of source code is discarded as soon as the next line of source is read in from the source file. Regards, Rob Craig Rapid Deployment Software http://members.aol.com/FilesEu/