Comment by dgreensp

11 years ago

It's pretty strange to see a "Lisp" with so much syntax. Lots of infix notation, and even semicolons! Usually Lisps have a very simple reader that reads S-expression and a few other things, but here we have this:

  (define map
    { (A --> B) --> (list A) --> (list B) }
    F [] -> []
    F [ X | XS ] -> [(F X) | (map F XS)])

And this is one of the cases without any semicolons.

Shen also uses the atrocious "curried form" of function types, where the function that adds two numbers has type number->number->number, and the reader must do the mental gymnastics to convert it to (number,number)->number (and good luck when it's more complicated than that).

I wonder if you took a language like Haskell and changed some of the syntax to look Lispy if it could masquerade as a Lisp? I'm not saying that's what's happening, it's just hard to wrap my head around a syntax like this that claims to be Lispy.

You don't have to use any of the syntax if you don't want to. You can write directly in KLambda. Here's how `map` is defined in KLambda:

   (defun map (f l)
     (shen.map-h f l ()))

   (defun shen.map-h (f l accum)
     (cond ((= () l) (reverse accum))
           ((cons? l) (shen.map-h f (tl l) (cons (f (hd l)) accum)))
           (true (shen.f_error shen.map-h))))