User talk:Kevin Reid: Difference between revisions

reply
(reply)
Line 35:
 
On [[User:Kevin Reid/Common Lisp tasks]] you said my library isn't Lispy enough. Could you propose alternate syntax, then? [[User talk:foobie-bletch|Foobie Bletch]] 18:32, 11 August 2009 (UTC)
 
The problem with the syntax I saw is that it has not enough parentheses :) Or rather, specifically, you have to look forward to the "->", count back, and divide by two to know how many values/patterns are involved. If the syntax were analogous to cl:case (parens around each case, around the lists of patterns and items to be matched, and no decorative "->" symbol), I would be entirely happy with it:
 
<lang lisp>(toad-ecase (color left val right)
(('black (tree 'red (tree 'red a x b) y c) z d)
(tree 'red (tree 'black a x b) y
(tree 'black c z d)))
...)</lang>
 
As a practical example, by putting parens around each case, it is possible to easily copy and paste the whole case by selecting balanced parentheses (an entire s-expression); as it is one has to be very careful to find the boundaries.
 
This is entirely my own opinion, of course (though I think it is not unusual). --[[User:Kevin Reid|Kevin Reid]] 20:38, 11 August 2009 (UTC)