Re: three stupid newbie questions :-)
- Posted by Pete Lomax <petelomax at blueyonder.co.uk> Jan 20, 2004
- 435 views
On Mon, 19 Jan 2004 10:53:25 -0800 (PST), Guest <guest at RapidEuphoria.com> wrote: >posted by: shenpen at freemail.hu >sequence a="hello" >atom b=1 That's an old one. I know Karl put this in Bach (but then again, no debugger...) > >while not atom(line=gets(filehandle)) The inner compare is a sequence operation: if both lhs and rhs are atoms it returns pretty much what you might expect, if one is an atom, it compares that against all the elements on the other side, if both are sequences, they must be the same length or it stops with a fatal error. If the lhs and the rhs are same size/shape tree then you get back a same size/shape tree filled with 1's and 0's. FWIW I don't think that is particularly useful and would vote to change it, but it is a fairly core concept in the language. You have to use either: while 1 do line=gets(filehandle) if atom(line) then exit end if Or: function setline(object x) line = x return x end function while not atom(setline(gets(filehandle))) do 3) duplicate constants etc The interpreter should print a list of the sources and line numbers on which it is defined (introduced in 2.4), at the point where you use it and it cannot figure out which one you meant. There is an improvement in terms of correctly guessing which one is meant, due for 2.5. You'll have to wait for the release for precise details. Regards, Pete