Re: [q-lang-users] The implicit operator in Q
Brought to you by:
agraef
From: John C. <co...@cc...> - 2006-07-21 14:29:19
|
Albert Graef scripsit: > 1. forbid a variable as the head element of the toplevel expression on > the lhs of an equation I think it's against the spirit of Q to forbid something for no particular reason, just because something that seems equivalent is forbidden for good reason. So I'd say no. > 2. never reduce a function application with a "const" in the head, even > if there's a rule which allows this This would be very surprising. Rules should either work or provoke an error. > 3. forget about "const" and allow rules with constants in the head (but > this means that an equation like "0=1;" would be valid Q again) That makes hash of the idea of constructors, which is a very important one. 0 is just as much a constructor as bin_stream. > 4. be happy that Q still leaves some dirty tricks to be discovered by > the master Q programmer ;-) Indeed, though I think this particular trick could now be documented in the manual. > Note that this invisible operator is in fact just function application. > Since expressions in Q are not subject to any typing constraints, > nothing keeps you from writing something like "0 1" which applies the > "function" 0 to the "argument" 1. I discovered this when playing with my Chicken egg; at that time I didn't have identifiers working. -- Knowledge studies others / Wisdom is self-known; John Cowan Muscle masters brothers / Self-mastery is bone; co...@cc... Content need never borrow / Ambition wanders blind; http://ccil.org/~cowan Vitality cleaves to the marrow / Leaving death behind. --Tao 33 (Bynner) |