3 ms·
Looking at the examples in the doc. That’s just tuple/list unpacking in Python. Am I misreading it?
by aynyc 6y ago
Looking at the examples in the doc. That’s just tuple/list unpacking in Python. Am I misreading it?
- ketzu 6y agoThe linked doc seems to show only what python does as tuple unpacking, but as far as I know elixir can also do the matched unpacking. Based on [1] (which also gives a more matchy example), elixir just has a warning when not using the variable in the case block and you can denote that you want to match against the contents of the variable by prepending ^. [1] https://www.reddit.com/r/programming/comments/lgqhmj/stack_overflow_users_rejoice_as_pattern_matching/gmtypn2/ https://www.reddit.com/r/programming/comments/lgqhmj/stack_o...