dash.el
dash.el copied to clipboard
Make `-let` support clojure stuff
I was just looking at the code from the other PR, and it ocured to me, why not make -let's [] syntax match what clojure has?
See https://clojuredocs.org/clojure.core/let
It seems nice :)
Extending (-let [p s] ..) to (-let [p1 s1 p2 s2 ..] ..) would be a nice first step. :or and :as requires a bit more effort :P
There is some :keys and :as things, I don't know what it does yet. But yea, more assignment forms was what I primarily ment. I've always found that syntax a bit... friendlier.
Right, so :keys [foo bar] rather than &plist* :foo :bar (#111). Can string and symbol keys be handled in some way? :keys ["foo" :bar] looks a bit odd.
Sorry, getting a bit late. Probably :keys would only handle keywords.
As I understand it :as is the equivalent of haskell foo@(structure) right? I very much want to have that :) I would implement this using &as to stay consistent though.
:or seems less useful, but sometimes it might be nice (e.g. inside -when-let or -if-let forms)
We can't easily have :keys because we can't figure out the type of the structure we pass in to destructure, so we have to hint with &plist etc.