Marco Antoniotti
1/1/2016 11:44:00 AM
On Friday, January 1, 2016 at 12:26:56 AM UTC+2, Kaz Kylheku wrote:
> On 2015-12-31, WJ <w_a_x_man@yahoo.com> wrote:
> > Griff wrote:
> >
> >> On Nov 23, 5:57 pm, Rainer Joswig <jos...@lisp.de> wrote:
> >> > I was just thinking about that topic and had some argumentation idea.
> >> > Guess that's not new, but it still could be handy if
> >> > your Ruby friends ask you why you need macros when Ruby
> >> > has blocks and Ruby can do all the cool things.
> >>
> >> Ask your Ruby friends to show you how to implement a 'for' loop in
> >> Ruby!
> >
> > MatzLisp (Ruby):
> >
> > def iter low, high, step=1
> > while low <= high
> > yield low
>
> Fake generator nonsense that just invokes an implicit callback.
>
> > low += step
> > end
> > end
> >
> > iter(0,8,2){|i| puts "The index is #{i}."}
>
> Anonymous function just to implement a loop? Inefficient.
>
> Also, you need to support some proper loop syntax. Ideally,
> it would look like this:
>
> for (i = 0 to 8 step 2)
> puts "The index is #{i}"
>
> or something very similar. No {|i| ...} bullshit.
Kaz. The actual program posted by the WJ-bot is in Whitespace. Just pass the full text to the WS compiler 3:)
Happy New Year.
--
MA