On Friday, 21 October 2016 at 19:00:55 UTC, Nick Sabalausky wrote:
On 10/20/2016 10:16 PM, Chris M. wrote:
So I know you can do some pattern matching with templates in
D, but has
there been any discussion about implementing it as a language
feature,
maybe something similar to Rust's match keyword
(https://doc.rust-lang.org/stable/book/patterns.html)? What
would your
guys' thoughts be?
What I've been really wanting for a long time is the one-two
combo of Nemerle's variants and pattern matching:
https://github.com/rsdn/nemerle/wiki/Grok-Variants-and-matching
There is std.variant, though I haven't used it much myself and
don't know how well it compares. Seems like that library would
provide a good basis for providing pattern matching though.