User loginNavigation |
Usefullness of constantsHello, there. This actually is my first post here, but I've been reading LtU for about a year. Background: I am implementing a small, general purpose procedural language, mainly for gaining some knowledge and insight into subject. I am using ANTLR for parser/lexer generation (Java-ish), and, don't laugh - PHP as a output - mainly because I feel rather familiar with it, and also because I intend to use this language for web - webserver served. So far I have done basics - overall structure, function declaration/compile time argument checking, general language statement (if, for, etc.) implementation. Question: What are the reasons for constants (like - define("SOME_CONST", "My Fancy Value"); - PHP) in languages that do not compile directly to machine code? As for my language, it would seem logical to use functions (parameterless) returning constant values instead of adding another "subsystem" for constants. Not that I am too lazy, to do it, just wondering if there are any other reasons, asaide from potential speed-up? Am I missing some point? Thank You, By K at 2008-08-09 18:57 | LtU Forum | previous forum topic | next forum topic | other blogs | 6513 reads
|
Browse archives
Active forum topics |
Recent comments
32 weeks 6 days ago
33 weeks 32 min ago
33 weeks 38 min ago
1 year 3 weeks ago
1 year 7 weeks ago
1 year 8 weeks ago
1 year 8 weeks ago
1 year 11 weeks ago
1 year 16 weeks ago
1 year 16 weeks ago