Re: [q-lang-users] New stuff in cvs: multichar ops, views
Brought to you by:
agraef
From: John C. <co...@cc...> - 2007-05-31 04:15:10
|
Albert Graef scripsit: > > (I always get bitten by unary minus in Q, still.) > > Care to explain why? I'd say that its usage is rather straightforward. > The precedence is the same as in Pascal (IIRC), all you have to remember > is that '-' in sections always denotes *binary* minus so to denote the > unary minus function you have to write 'minus'. I always forget that -2 is the application of minus to 2 rather than a constant, so I write things like "foo -2", which then turns out to be "(foo -) 2". > As a first exercise, I just comitted some changes which turn Complex > into an ADT with the virtual constructor (:+). So the constant i now > prints as 0:+1. I don't like that much. I suppose there is no way to make 0+1*i the constructor/view? I guess not, since Q is eager. -- John Cowan http://www.ccil.org/~cowan <co...@cc...> "Any legal document draws most of its meaning from context. A telegram that says 'SELL HUNDRED THOUSAND SHARES IBM SHORT' (only 190 bits in 5-bit Baudot code plus appropriate headers) is as good a legal document as any, even sans digital signature." --me |