Re: [Readable-discuss] wisp and readable - common expressions
Readable Lisp/S-expressions with infix, functions, and indentation
Brought to you by:
dwheeler
From: David A. W. <dwh...@dw...> - 2014-11-21 23:48:58
|
It is obviously possible to change the semantics of leading period. I am hesitant to add yet another operator; you may disagree but I really tried to make it a short list. I also really wanted to fix the notation, but leading period is basically never used so that is probably not really a problem. Let me think about it. On November 21, 2014 4:38:13 PM EST, Arne Babenhauserheide <arn...@we...> wrote: >Am Mittwoch, 19. November 2014, 18:34:25 schrieb David A. Wheeler: >> It's possible to write code that is interpreted *identically* >> on both wisp and sweet when indentation is enabled. > >That’s cool! > >> In sweet, a "." at the >> beginning of a line post-indent is basically ignored. > >Would it be possible to generalize this, so sweet would also make the >full line a continuation instead of only ignoring the dot? > >That would make many uses of \\ unnecessary, and wisp would then be >almost a subset of sweet. > >> Thus, in both sweet and wisp: >> a b c >> d e >> . f >> g h >> becomes: >> (a b c >> (d e) >> f >> (g h)) > >> If wisp interpreted neoteric-expressions by default, >> then many more expressions work in both systems, e.g.: >> defun factorial() >> if {n <= 1} >> . 1 >> {n * factorial{n - 1}} > >That’s true, but then lines with a single element would be treated >differently than lines with multiple elements, and that is a gotcha I >want to avoid. > >It hits you with things like newline > >wisp: > define : hello > display "Hello World!" > newline > define : hello2 who > format #t "Hello ~A!\n" who > hello2 "wisp" > >sweet: > define hello() > display "Hello World!" > newline() > hello() > define hello(who) > format #t "Hello ~A!\n" who > hello2 "sweet" > ; or > hello2("sweet") > >> So while neoteric-expressions provide two ways to write something, >> in practice, there's a "more readable" way that better expresses the >purpose >> in each case. > >It’s almost as if you had intentionally motivated a quote I found >yesterday but didn’t share because I didn’t know whether it would come >off as offensive. With that kind of (unintentional?) prep-work: > > > wisp-expressions are not as sweet as readable, but they KISS. > > >:-) > >Best wishes, >Arne --- David A.Wheeler |