[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Readable-discuss] Proposal: make $ serve as GROUP, leave \ to always be SPLIT

This page is part of the web mail archives of SRFI 110 from before July 7th, 2015. The new archives for SRFI 110 contain all messages, not just those from before July 7th, 2015.



Am Freitag, 3. Mai 2013, 23:13:31 schrieb David A. Wheeler:
>  Another issue I see with the current leading $ behavior is this
> > inconsistency:
> > 
> > foo (a b) ==> (foo (a b))
> > foo $ a b ==> (foo (a b))
> > (a b) ==> (a b)
> > $ a b ==> ((a b))  ; huh?!

The inconsistency is not in $, but in treating single-item lists specially:

a â a
a b â (a b)

Since (a b) is a single item, it gets treated as single item.

It makes the code more readable, but it also leads to some side-effects.

Thatâs one of the things I changed in wisp: To get the single-item behaviour, you have to prefix the item with a dot (.). The advantage is added consistency, but at the same time it is a trap: Itâs easy to forget the . for a return value (real coding verified that assumption from Alan (I think it was Alan)).

Not adding brackets for a single item also has the advantage, that you can copy-paste lisp-code into readable. If you do the same in wisp, you have to prepend every top-level bracket with a dot. 

Readable:

    (a b (c)) â (a b (c))

Wisp:

    . (a b (c)) â (a b (c))

On the other hand:

Readable:

    $ a b â ((a b))

Wisp:

    : a b â ((a b))
-or-
    (a b) â ((a b))

Best wishes,
Arne
--
Ein WÃrfel System - einfach saubere Regeln: 

- http://1w6.org

Attachment: signature.asc
Description: This is a digitally signed message part.