[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: What?



Hi Bruce,

could you please document this extension on the Wiki?
There are already several Fun-O extensions mentioned.

Thanks,

	Gabor


Am Sonntag den, 11. August 2002, um 23:30, schrieb Bruce Hoult:

> Oh, wait ... I did add a "foo = bar" clause to the for loop as a
> shorthand for "foo = bar then baz" where bar and baz are the same
> expression.  So the summing example can be written as:
>
>  define method sum-stream (stream)
>    let sum = 0;
>    for (n = read-line(stream, on-end-of-stream: #f),
>           while: n)
>      sum := sum + string-to-integer(n);
>    end;
>    sum
>  end;