in reply to RFC: Destructuring Assignment (aka Unpacking aka Type Patterns) in pure Perl
I can't easily picture how you'd hammer it into the language without needing parser changes but an Haskell/ML/Erlang destructuring where things are pulled apart based on types and/or guard conditions and the like could be very interesting.
You might also look at clojure for more inspiration that's a bit closer to the ES6 stuff (I believe).
E.g. where you can have something like [{:keys [foo bar]} arg_map] which pulls the values at the named keys out of arg_map into vars named after the respective keys.
The cake is a lie.
The cake is a lie.
The cake is a lie.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: RFC: Destructuring Assignment (aka Unpacking aka Type Patterns) in pure Perl
by LanX (Saint) on Jul 03, 2020 at 20:57 UTC | |
by Fletch (Bishop) on Jul 04, 2020 at 03:52 UTC | |
by LanX (Saint) on Jul 04, 2020 at 10:35 UTC |