CVS: sml-dist/src/system/smlnj/init core.sml,1.14,1.15
Matthias Blume <[email protected]>
| Newsgroups | gmane.comp.lang.sml.smlnj.commits |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/smlnj/sml-dist/src/system/smlnj/init
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6194/src/system/smlnj/init
Modified Files:
core.sml
Log Message:
brought back SMLofNJ.Susp
Index: core.sml
===================================================================
RCS file: /cvsroot/smlnj/sml-dist/src/system/smlnj/init/core.sml,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** core.sml 11 Nov 2004 00:12:41 -0000 1.14
--- core.sml 25 Feb 2005 20:46:23 -0000 1.15
***************
*** 169,192 ****
* able to compute pids for them.) *)
! (* LAZY: The following is hard-wired and needs to track the object
! * descriptor definitions.
! *)
! val TSUS = 0; (* == ObjectDesc.special_unevaled_susp *)
! val TSES = 1; (* == ObjectDesc.special_evaled_susp *)
! datatype 'a susp = Something of 'a (* Just a hack for bootstrapping *)
! fun delay (f : unit -> 'a) = (InLine.mkspecial(TSUS , f)):('a susp)
! fun force (x : 'a susp) =
! if InLine.i31eq((InLine.getspecial x),TSUS)
! then let
! val y : 'a = recSub (InLine.cast x, 0) ()
! in
! (InLine.cast x) := y;
! InLine.setspecial (InLine.cast x, TSES);
! y
! end
else recSub (InLine.cast x, 0)
!
(* equality primitives *)
--- 169,200 ----
* able to compute pids for them.) *)
! local
! structure Susp :> sig
! type 'a susp
! val delay : (unit -> 'a) -> 'a susp
! val force : 'a susp -> 'a
! end = struct
! (* LAZY: The following is hard-wired and needs to track the object
! * descriptor definitions.
! *)
! val TSUS = 0; (* == ObjectDesc.special_unevaled_susp *)
! val TSES = 1; (* == ObjectDesc.special_evaled_susp *)
! (* Just a hack for bootstrapping: *)
! datatype 'a susp = Something of 'a
! fun delay (f : unit -> 'a) = InLine.mkspecial(TSUS,f): 'a susp
! fun force (x : 'a susp) =
! if InLine.i31eq((InLine.getspecial x),TSUS)
! then let val y : 'a = recSub (InLine.cast x, 0) ()
! in InLine.cast x := y;
! InLine.setspecial(InLine.cast x, TSES);
! y
! end
else recSub (InLine.cast x, 0)
! end
! in
! open Susp
! end
(* equality primitives *)
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click