groovy-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jorge Franco <grooscr...@gmail.com>
Subject Proposal - Pattern matching elixir way
Date Fri, 25 Nov 2016 23:29:16 GMT
Hello!

I'm playing with elixir language lately, and I like the pattern matching
and guards in functions. I'm sure more proposal about pattern matching have
been done. And yes, in groovy switch is very powerful. But I think can be
interesting add something similar in groovy, so then groovy is more
functional friendly and readable.

Please take a look at this implementation idea, using AST's:
https://gist.github.com/chiquitinxx/296ec6cd0cf4d5afe01e6693f14a877b

What do you think? not very interesting, maybe other implementation ideas,
too much complex, switch wins, ...

Thank you for your time.

Some links to elixir:
http://elixir-lang.org/getting-started/pattern-matching.html
http://culttt.com/2016/05/23/multi-clause-functions-pattern-matching-guards-elixir/

Mime
View raw message