Sort of like your slice, but you also can provide default values if things are missing. E.g. if arg_map didn't have anything at the key :foo the variable foo would get be the string "foo missing".
(let [{:keys [foo bar] :or {foo "foo missing"}} arg_map] ;; ... )
You'd prossibly need something like my $foo = exists $arg_map{foo} ? $arg_map{foo} : "foo missing" and you'd need to do each variable separately. (I've not messed with clojure in long enough that I'm probably explaining this poorly, to boot . . .)
The cake is a lie.
The cake is a lie.
The cake is a lie.
In reply to Re^3: RFC: Destructuring Assignment (aka Unpacking aka Type Patterns) in pure Perl
by Fletch
in thread RFC: Destructuring Assignment (aka Unpacking aka Type Patterns) in pure Perl
by LanX
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |