Re: Iterator Syntax
by Buggs other posts by this author
May 8 2002 1:37AM messages near this date
Re: Iterator Syntax
|
Re: Iterator Syntax
On Tuesday 07 May 2002 16:24, Glen Starchman wrote:
> On Tuesday 07 May 2002 02:47 am, Donal K. Fellows wrote:
[...]
> Hm... originally, I had something that looked like this:
>
> iterator_function() (block_arg,...) { block_body}
>
> That turned out to be rather hard to debug, IMO.
ya IMO too
[...]
> > [* Just one value at a time from the iteratable entity? Nah. But then
> > I'd go for iterating over more than one iteratable object at a time
> > too. ]
>
> Some iterators return multiple values, if that's what you mean. It would be
> rather trivial, for example, to create a String method that returned an
> arbitrary number of chars per iteration:
>
> "hello".each(3) { |x| print ("chars=%s", x)
>
> => hel
> => lo
what about
"hello".each(3)-> x {print ("chars=%s", x)}
if you still have "-> " spare
think
x <-"hello".each(3) {print ("chars=%s", x)}
is funny
And hey is that all you let us know about your language ;P
come on give us an URL
Buggs
Thread:
Glen Starchman
Donal K. Fellows
Glen Starchman
Pixel
Glen Starchman
Buggs
Mathieu Bouchard
Buggs
Mathieu Bouchard
Glen Starchman
|