[nem-en] Questions about lazy evaluation
mei
mei at work.email.ne.jp
Mon Jun 12 18:36:05 CEST 2006
Kamil Skalski wrote:
> BTW, I just commited some changes in implicit operators for LazyValue,
> so you can now write this code as:
>
> def tarai(x : int, y : int, z : LazyValue[int]) : int {
> if (x <= y) {
> y
> }
> else {
> tarai (
> tarai (x-1, y, z),
> tarai (y-1, z, x),
> lazy (tarai (z-1, x, y)))
> }
> }
Pretty nice !
Thanks.
--
mei <mei at work.email.ne.jp>
More information about the devel-en
mailing list