Re: [q-lang-users] Q 7.2 RC1 Issue 2: Notation
Brought to you by:
agraef
From: Albert G. <Dr....@t-...> - 2006-06-21 00:00:08
|
John Cowan wrote: > True, but you will see "1 over 5+2 over 3*i", which was the example in > the first draft of my original e-mail. Yes, you're right, I forgot about that case. So that really makes it an issue. "1%5+2%3*i" is a lot more readable than "1 over 5+2 over 3*i", I fully agree with that now. > I'm beginning to wonder if this unparsing is the Right Thing after all: > it makes it harder to see what is a normal form and what is not. If you > type "1 over 5+2 over 3*i" into a Q 7.2 RC1 interpreter, you get back > "1 over 5+2 over 3*i", as if the expression were in fact in normal > form. But it's not; the underlying normal form is "complex::complex > (rational::rat 1 5) (rational::rat 2 3)", which is then effectively > denormalized for printing purposes. Yes, I really should add some remarks about this to the manual. I still think that this is very desirable or even essential for the benefit of readability. And it also resolves the issue of external objects not being printable and serializable, which was another one of my pet peeves. BTW, it's easy to get rid of the custom unparsings if you don't want them (e.g., for debugging purposes). Just add the equation "unparse = ();" to your program. I should mention that in the manual, too. Albert -- Dr. Albert Gr"af Dept. of Music-Informatics, University of Mainz, Germany Email: Dr....@t-..., ag...@mu... WWW: http://www.musikinformatik.uni-mainz.de/ag |