Re: [q-lang-users] [qlist] SDL anyone?
Brought to you by:
agraef
From: Andrew B. <and...@ya...> - 2006-12-28 05:53:23
|
On 27 Dec 2006, at 17:02, Albert Graef wrote: > Andrew Berg wrote: >> It's really a shame about the ":" character not being >> allowed in identifiers... I'll have to campaign for that at some >> point. :) > > Unfortunately that's not possible; ':' is already used for type > matching, and '::' for qualified identifiers. But there are two > delimiters in the ASCII range, '%' and '?', which aren't currently > used > and thus can be declared as operators. > The crazy part is that I don't even want it as an operator. The syntax I'm looking for is their funny named parameters. Example (in Obj-C (meaningless, but I'm just trying to show syntax)): r = [SomeDictThing new]; for (i = 0; i < 10; i ++) { [r at: i put: j]; } The part I want to co-opt is the 'r at: i put: j' where r would be my class instance, and 'at:' and 'put:' are q constructors which I would just use as place holders, and the 'i' and 'j' would be some kind of variables (or parenthesized expressions). I could do it with the ':' dropped, but the readability suffers. I could use some Unicode ':' replacement, but the type-ability suffers. I could use a character that is allowed in identifiers, like '_', but that's just silly. I do understand that things are as they are for some good reasons. My point was just that if the grammar could be mangled a bit to support it, I will probably make a sub-dialect to support my own evil designs. And I would probably whine and cajole to get it added into the trunk. :^) But, don't worry yet. It is low priority. Before that, I have a SDL wrapper to make work. -andrew |