Since the type of Lisp I most often write is Clojure, I’m disappointed (though not very surprised) that this syntax isn’t any more applicable to Clojure than sweet-expressions. Clojure’s [] and {} brackets can be represented as vec and hash-map, but it just doesn’t look as clear. For example, starting with this random snippet of ClojureScript (source):
(defn modifier-keys
[e]
(let [shift (.. e -shiftKey)
meta (.. e -metaKey)
ctrl (.. e -ctrlKey)
alt (.. e -altKey)]
{:shift shift :meta meta :ctrl ctrl :alt alt}))
This would be the equivalent Wisp-syntax ClojureScript:
defn modifier-keys
vec e
let
vec
shift : .. e -shiftKey
meta : .. e -metaKey
ctrl : .. e -ctrlKey
alt : .. e -altKey
hash-map :shift shift :meta meta :ctrl ctrl :alt alt
It’s much harder to spot the function parameter e in vec e than in [e]. And changing that line to [ e with no closing bracket doesn’t look right either.
Embrace the parentheses. Love the parentheses.
Since the type of Lisp I most often write is Clojure, I’m disappointed (though not very surprised) that this syntax isn’t any more applicable to Clojure than sweet-expressions. Clojure’s
[]
and{}
brackets can be represented asvec
andhash-map
, but it just doesn’t look as clear. For example, starting with this random snippet of ClojureScript (source):This would be the equivalent Wisp-syntax ClojureScript:
It’s much harder to spot the function parameter
e
invec e
than in[e]
. And changing that line to[ e
with no closing bracket doesn’t look right either.A while back there was a version of this idea as a clojure library. I always liked the haskell-style
:
. Likely to have bit-rotted though.This may seem trivial, but it definitely makes Lisp look more appealing to me!
Or we can try a syntax with less parens: Arc’s syntax for CL for example https://github.com/g000001/arc-compat
I’m not familiar with Arc or CL, but the examples on that page still have a buttload of parens.
Folks are going to tar and feather me but: It looks like Python with the colons inverted :)
It also has quite a Haskelly feel to it, with a bit more noise.
I believe Python was one of the inspirations, yes.
Scopes’ syntax is even more Pythonic.