104
« on: 2006-07-24 01:44:45 »
My thoughts (assuming this syntax would be used to define a script [de]compiler):
1. If comments are #, then #define is a comment, so at least make comments be ##.
2. In my opinion, #directives aren't "clean" and they get confusing sometimes. My opinion would be to use either
define dic=Entity[0];
or
alias dic=Entity[0];
or
const dic=Entity[0];
3. <bank>[address] structure is compact, but might get really confusing, why not make it bank[3], bank[3] or bank<3>
4. To keep a common syntax style, and given C's [] means "subscript", it would be good to keep all of them in a similar way, like Entity[0], Script[0], Bank[3], Address[32], etc... Also with some (possible) compact forms like Bank[3][32] maning Bank[3], Address[32]
5. If you want to do entity enumerations, you could just do some simplified syntax like entities { dic, cloud } (with optional =number if they weren't sequential)
Now, one alternative syntax that looks funny but might be harder to code in:
# comment
# <> defines a subscript, {} defines a namespace, everything inside {} refers to whatever preceeded it
alias init=0; #integer alias
alias dic=entity<0>; #entity alias
<dic>script<init>{#define init and base scripts for 'entity<0>script<0>'
init {...}
base{...}
}
entity<2>script<1>init { ... } #defines just the init part
entity<2>{script<3>=script<1>} # copy script<1> to script<3>
#also you could do <> ranges, might go like <4..20> or <4->20>, and if you wanted to make it even more complex: <1..3,5..12,15,18>
... bank<3>address<32> ...
Yes, I like <> more than [], maybe because it's easier to access them in my spanish kbd.