Title: FreeCode Signature
Ok, I'll bite :] I will answer these with what I intended when I wrote the code and the spec.

' x
  y
=> (quote (x y))
  
Agree

'x
 y
=> ((quote x) y)
  
Agree
' ' x
  y
=> (quote ((quote) x y))
; BUG? I think this is a bug in the code.  I would think that a ' followed by any _expression_
; should be fine, even if it's another ' - if we fix/interpret the spec as above, then
; clearly ANY _expression_ should be allowed after the ' ... even another '.
; Thus, I think this should be:
; (quote (quote (x y))
; That's certainly how I read the spec, too. Anyone else agree, or disagree?
  
I actually disagree to the test, not to the result. I think this code should be an error. The reason is that no other symbol adds parenthesis around the block more than once (ref. group and group group). The above should have read:

'
  ' x y

x
 y
=> (x y)
  
Agree
group
 x
  y
=> ((x y))
  
Agree. Note the implementation detail - the symbol group is an ordinary symbol, removed if first in a list coming out of the reader, done during a special last-pass over the input.
group x
=> (x)
; This makes sense too; I think the code passes the "what is reasonable" test here.
;  But this seems to point out a spec bug; in the spec, the productions:
;   expr -> GROUP head
;   expr -> head
; have EXACTLY the same effect - which would in theory mean that GROUP has
; no effect if there's only a head.  But the code doesn't do that, and I think it's because
; the spec is wrong and the code is right (in this case).
; Frankly, I think that GROUP ought to be a single, simple rule that recurses to expr.
  
The spec is wrong, but your patch is wrong too - you should not remove multiple group from an _expression_, only the first one. E.g. (group x y z) becomes (x y z) and (group group group x y) becomes (group group x y).


group x
  y
=> (x y)
; BUG?  Isn't this an error?  This is the same result as without "group", but
; I would think this should be ((x y)) instead.
; In general, I think "group" should just mean "add extra (...) around stuff".
  
Nope. This is intentional. Group does not add () around an _expression_, this is only ever done by indentation. What group means is an special ("empty")  symbol that is removed if found first in an _expression_. To get ((x y)) you could write:

group
  x
    y

or

group
  x y


--



Konsulent, Fri Programvare / Free Software Consultant
Cell: +47 - 91 17 05 93
Phone: +47 - 21 53 69 00, Fax: +47 - 21 53 69 09
Addr: Slemdalsveien 70, PB 1 Vinderen, 0319 Oslo

 Free beer costs nothing, freedom costs a fight.
 Free beer lasts an eavening, freedom lasts a lifetime.

Attachment: signature.asc
Description: OpenPGP digital signature

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Readable-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/readable-discuss

Reply via email to