Timeline for Pattern matching repeated structures with named subexpression components
Current License: CC BY-SA 3.0
6 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Jan 24, 2013 at 3:33 | comment | added | LBushkin | @Rojo: This blog article gives some good examples of destructuring in Clojure. | |
| Jan 24, 2013 at 3:29 | comment | added | LBushkin | @Rojo - I was expecting a_ and b_ to represent a Sequence of expressions derived by extracting them from the expression x. I will refine my question to make it a bit clearer. | |
| Jan 24, 2013 at 3:27 | comment | added | Rojo | @LBushkin even though rm clearly got your intentions, I insist it would be nice for you to make your question clearer. Your intentions should be understood from the question, for future visitors. Furthermore, I'm intrigued, what were you expecting a_ and b_ to represent? I have no List or Clojure background | |
| Jan 24, 2013 at 3:21 | comment | added | LBushkin | Indeed, I understand my mistake. I assumed that a_ and b_ just assigned a name to that portion of the expression, but they actually do more. They fix a value to that portion of the expression that then has to match in all subsequent arguments. It seems that MMA pattern matching isn't quite the same as expression destructuring techniques that one finds in languages like Lisp or Clojure. | |
| Jan 24, 2013 at 3:18 | vote | accept | LBushkin | ||
| Jan 24, 2013 at 2:33 | history | answered | rm -rf♦ | CC BY-SA 3.0 |