Closed flbulgarelli closed 8 years ago
Shouldn't it receive a closure as its argument? El ene. 1, 2016 14:41, "Franco Leonardo Bulgarelli" < notifications@github.com> escribió:
That is a simpler case of range iteration:
3.times { someone.doSomething() }
We could name it times, or timesDo or timesRepeat . I like the first one.
— Reply to this email directly or view it on GitHub https://github.com/uqbar-project/wollok/issues/566.
@matifreyre that's actually a closure. Just that, as I noticed :) the new closure's syntax could be confused with blocks (sets of statements/expression).
This can be read as:
3.times( { someone.doSomething() })
Maybe that's more explicit.
You mean the parenthesis are optional even when you do have parameters? Indeed it looks like a block. If that's the case, it seems very confusing to me. I'd rather not have that option, or at least limit it to no-parameter methods.
On Fri, Jan 1, 2016 at 6:26 PM, javierfernandes notifications@github.com wrote:
@matifreyre https://github.com/matifreyre that's actually a closure. Just that, as I noticed :) the new closure's syntax could be confused with blocks (sets of statements/expression).
This can be read as:
3.times ( { someone.doSomething() } )
Maybe that's more explicit.
— Reply to this email directly or view it on GitHub https://github.com/uqbar-project/wollok/issues/566#issuecomment-168338866 .
The parenthesis are optional only for a message with a unique parameter which is a closure.
On Fri, Jan 1, 2016 at 7:13 PM, Matías Freyre notifications@github.com wrote:
You mean the parenthesis are optional even when you do have parameters? Indeed it looks like a block. If that's the case, it seems very confusing to me. I'd rather not have that option, or at least limit it to no-parameter methods.
On Fri, Jan 1, 2016 at 6:26 PM, javierfernandes notifications@github.com wrote:
@matifreyre https://github.com/matifreyre that's actually a closure. Just that, as I noticed :) the new closure's syntax could be confused with blocks (sets of statements/expression).
This can be read as:
3.times ( { someone.doSomething() } )
Maybe that's more explicit.
— Reply to this email directly or view it on GitHub < https://github.com/uqbar-project/wollok/issues/566#issuecomment-168338866>
.
— Reply to this email directly or view it on GitHub https://github.com/uqbar-project/wollok/issues/566#issuecomment-168340988 .
:+1: to this, even when we I have serious doubts about the now syntax closure.
On Fri, Jan 1, 2016 at 8:03 PM, Nicolas Passerini npasserini@gmail.com wrote:
The parenthesis are optional only for a message with a unique parameter which is a closure.
On Fri, Jan 1, 2016 at 7:13 PM, Matías Freyre notifications@github.com wrote:
You mean the parenthesis are optional even when you do have parameters? Indeed it looks like a block. If that's the case, it seems very confusing to me. I'd rather not have that option, or at least limit it to no-parameter methods.
On Fri, Jan 1, 2016 at 6:26 PM, javierfernandes <notifications@github.com
wrote:
@matifreyre https://github.com/matifreyre that's actually a closure. Just that, as I noticed :) the new closure's syntax could be confused with blocks (sets of statements/expression).
This can be read as:
3.times ( { someone.doSomething() } )
Maybe that's more explicit.
— Reply to this email directly or view it on GitHub < https://github.com/uqbar-project/wollok/issues/566#issuecomment-168338866
.
— Reply to this email directly or view it on GitHub https://github.com/uqbar-project/wollok/issues/566#issuecomment-168340988 .
Hey @matifreyre @npasserini I have started another thread about optional parenthesis #564 Could we discuss them there?
Sure thing. I also agree with the "times" addition for integers.
That is a simpler case of range iteration:
We could name it
times
, ortimesDo
ortimesRepeat
. I like the first one.