[Oz] Help: Lazy evaluation ..
P Ravi Prakash
ravi at konark.ncst.ernet.in
Thu Jul 29 17:19:55 CEST 1999
Hi,
I want to use the lazy evaluation feature of Oz.
If I execute the code given below, it prints 2 in the browser and says
"Virtual memory exhausted." I am using Oz2. I am expecting it to
evaluate only the first three elements of the list.
Could some one please point out what is the mistake I am making?
Regards,
Ravi
----------------------------------------------------------------------------
\feed prelude
\feed Modules
declare
fun {GenWrap}
thread {Gen 1} end
end
fun {Gen N}
N|{Gen N+1}
end
K = {GenWrap}
{Browse {Nth K 2}}
{Browse {Nth K 3}}
----------------------------------------------------------------------------
+-------------------------------------------------------------------------+
|P Ravi Prakash, KBCS Division : Email: ravi at konark.ncst.ernet.in|
|National Centre for Software Technology: Phone: 620 1606 x 41, 12 =======|
|Gulmohar Cross Road 9, Juhu : Fax: 022-621 0139 ==============|
|Mumbai - 400 049, INDIA : ================================|
| Web: http://konark.ncst.ernet.in/~ravi/ |
+-------------------------------------------------------------------------+
-
Please send submissions to users at mozart-oz.org
and administriva mail to users-request at mozart-oz.org.
The Mozart Oz web site is at http://www.mozart-oz.org/.
More information about the mozart-users
mailing list