Re: [Readable-discuss] My first attempt: a process manager
Readable Lisp/S-expressions with infix, functions, and indentation
Brought to you by:
dwheeler
From: David A. W. <dwh...@dw...> - 2014-01-11 18:35:22
|
> On Sat, Jan 4, 2014 at 12:07 AM, Mike Gran <sp...@ya...> wrote: > > Hi. I thought I'd take a stab at using your readable project > > > > Result is attached. It is a process manager: a structure holds > > a list of functions and data and call the functions as a unit. > > Functions that return #f are removed from the manager, and > > functions that return #t are kept. > > > > > > My impressions are pretty favorable. I didn't love the > > let block syntax, so I used defines instead. I'm really glad they were overall favorable. On Fri, 10 Jan 2014 21:08:06 +0800, Alan Manuel Gloria <alm...@gm...> wrote: > Yes, let syntax is a big drawback with the "indentation implies > parentheses" strategy. Nothing is perfect, but I think it's very reasonable We have a general solution using leading "\\" that easily handles all cases, and <*...*> is a useful shorthand for handling let statements with short variable-definition blocks. > As a complete aside, in Haskell, there's a special "fallback" rule > where an error due to indentation matching will cause the parser to > attempt to close a group. This rule usually triggers in Haskell's > let...in syntax (basically, the "in" keyword is generally a syntax > error except after a let group, so the parser usually errors here when > indentation is used), which seems to imply to me that even Haskell has > some trouble with let syntax, which was simply "fixed" with this > hackish solution. > > xref http://www.haskell.org/onlinereport/syntax-iso.html#sect9.3 , > particularly Note 5. Fair enough. Again, nothing's perfect. > > Also, I used > > 'cond' in lieu of 'if' because I liked the look of having > > an 'else'. > > Yes, the "old" syntaxes like that tend to be very pretty in indentation syntax. I think "if" looks great: if {x < y} ! x ! y Obviously if you want a *keyword* to mark the else clause, that doesn't do it, but in that case "cond" is the better choice anyway. --- David A. Wheeler |