groovy-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Johannes Link <johannes.l...@gmail.com>
Subject Re: Proposal - Pattern matching elixir way
Date Fri, 25 Nov 2016 23:50:08 GMT
Using an annotation seems like a hackish way. I'd rather go with an extended version of switch
or even better a native matching parameter syntax. Just my 2 cents. 

Johannes 

> Am 26.11.2016 um 00:29 schrieb Jorge Franco <grooscript@gmail.com>:
> 
> 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