Re: 300 statements
- Posted by Falkon <Falkn13 at IBM.NET> Apr 28, 1998
- 507 views
From: Andy Kurnia >I would guess the following code has 22 statements, not 18: > (1) atom (2) sequence (3) question = (4) answer = (5) object (6) fn = > (7) if (8) abort (9) end if (10) while (11) input = (12) if (13) exit > (14) end if (15) question = (16) input = (17) if (18) exit (19) end if > (20) answer = (21) end while (22) close >Is it true? Or not? My guess is that the if...then..endif construct counts as one statement and the same for the while...end while. That would make it 18. But statements inside the constructs other than the base would be separate. That is "if x then y" is one statement, but "if x then y else z" is two. That's just my guess about the way a computer would see 'em though. It seems that the first case would just be a plain conditional jump but the second would require two steps, pick a jump address based on the condition, then jump to it. >1. I'd like to see RDS implementing an option to only count the number of > statements. It'd then be easy to know if I'm 4 statements away from > being unable to get debug informations. Write a routine that scans the file and counts the statements, edit your editor to run the routine from a menu. I think RDS can find plenty of more important things to implement if they want. Not that I'm saying EU needs a lot, just that many people have made suggestions and RDS no doubt has their own ideas and I think any of those would be higher priority than messing with the shareware limit. >3. 300 is annoying. 1000'd make more people register. (They'd get more to > try.) Eh...download another shareware language. Pick one. Any one. Compare methods. Most either include no documentation (or only minimal), cripple their compiler/editor so that you can't load/save/ or run any code, disable main parts of the language, leave out a necessary runtime, or give you a logic bomb that detonates after a certain amount of time or uses as their demo. Any/all of this as well as placing limits on the length of code you can experiment with or amount of memory you can use in your experiments. RDS, on the other hand, gives you everything fully documented and functionally unlimited as well as tons of examples. The only limit is how much you can debug. That does give you more to try. And it gets my registration fee. >Having iifs (immediate ifs, just like C's ?: operator) [and] having short-circuit boolean >evaluation is handy to save many statement counts, rather than having nested ifs This would help optimization...at the cost of confusion. Might end up with compiler directives for 'C-like evaluation syntax', 'Pascal syntax', 'ANSI-style', '16-bit', 'UNIX style' and everything else that's confusing about other languages. I wouldn't complain about short-circuiting in and of itself, (especially for those nested ifs), but I'd just as soon spend a couple extra minutes writing a couple extra lines than to spend a couple hours trying to figure out which way to write the lines with which combination of directives for best effect. Falkon