(I've just finished the pretty printing part in Pugs, so I'll use actual command line transcripts below. The leading "?" does not denote boolean context -- it's just telling pugs to do a big-step evaluation. Also, boolean literals are written in their Scheme forms.)
In S06, the meaning of chaining comparison operators is defined as a derived form: (a < b < c) ==> (a < b) and (b < c) With the note that "b" must be evaluated at most once. However, if taken literally, it gives this rather weird result: pugs> ? 2 < (0 | 3) < 4 (#t|#t) My intuition is that it should be equivalent to this: pugs> ? (2 < 0 < 4) | (2 < 3 < 4) (#f|#t) That is, the autothreading should operate on the whole comparison chain, treating it as a large variadic function with short-circuiting semantics. Is this perhaps "saner" than the blind rewrite suggested in the spec? Also, consider this: pugs> ? 1|2 => 3|4 (((1 => 3)|(1 => 4))|((2 => 3)|(2 => 4))) Since junctions are documented to only "flatten" on boolean context, here the pair-building arrow has been autothreaded. Is it the intended semantic? What about the list-building semicolon? Thanks, /Autrijus/
pgpj7CbHk75Wh.pgp
Description: PGP signature