Open muriloadriano opened 11 years ago
Well, I do prefer the current syntax. What do you guys think about? @heuripedes @gogo40
Yeah, I like |x| !
2013/1/12 Felipe Pena notifications@github.com
Well, I do prefer the current syntax. What do you guys think about? @heuripedes https://github.com/heuripedes @gogo40https://github.com/gogo40
— Reply to this email directly or view it on GitHubhttps://github.com/clever-lang/clever/issues/230#issuecomment-12185947.
Atenciosamente, Péricles Lopes Machado
"Uma verdade claramente compreendida não pode ser escrita com sinceridade."
Marcel Proust
The idea isn't replace the current syntax, but have an alternate syntax.
Ah, got it. I'm not against alternative syntax at all. :)
As convenient as it may look, I do not like the |x| {} syntax for the following reasons:
It makes sense, Higor. But what do you mean by simplify/shorten the current syntax? What do you suggest?
What if we introduce a new symbol?
var func = $(x, y) {
return 'foo' + x + y;
}
arr.each($(x) { println(x * x); });
For simplicity one might want to have a simplified way to write its anonymous functions. Consider the
each
method. Currently we would have to write something like:It would be nice if we were able to write less. My proposal is something like:
Notice that the missing
;
is intentional. The;
for the last sentence should be optional.