| I think, in hindsight, my idea of allowing "optional parameters" in destructurings was too byzantine to work... http://arclanguage.org/item?id=2540 ...but here's another idea to resolve this issue that I think is better. You be the judge! Remember, this very succinct function (which removes identical pairs) has a rare bug when there is an item in the list that is nil. (def rem-pairs ((a . (b . c)))
(when a
(if (is a b) (rem-pairs c)
(cons a (rem-pairs:cons b c)))))
What, however, if we could do THIS: (def rem-pairs ((a . (b . c)))
(when _
(if (is a b) (rem-pairs c)
(cons a (rem-pairs:cdr _)))))
Is there any reason we couldn't just bind the _ to the first parameter of the current function across the board? (This would also synergize nicely if we had _2, _3, etc. which I support, as well)This would mean that [...] no longer means "a function that has a single parameter bound to _" Instead, it would just mean "a function" and would have all optional parameters. The user would have the ability to refer the first parameter with _, but that would be a feature independent of the bracket syntax. |