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
signature.asc
Description: This is a digitally signed message part.
------------------------------------------------------------------------------ Get 100% visibility into Java/.NET code with AppDynamics Lite It's a free troubleshooting tool designed for production Get down to code-level detail for bottlenecks, with <2% overhead. Download for free and get started troubleshooting in minutes. http://p.sf.net/sfu/appdyn_d2d_ap2
_______________________________________________ Readable-discuss mailing list Readable-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/readable-discuss