Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Annotation of /tests/trunk/bugs/tests.obsolete/bug905.6.sml
ViewVC logotype

Annotation of /tests/trunk/bugs/tests.obsolete/bug905.6.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2460 - (view) (download)

1 : dbm 548 (* bug905.6.sml *)
2 :    
3 :     functor H(X: sig
4 :     functor F1(type t): sig val put: t -> unit
5 :     val get: unit -> t
6 :     end
7 :     end)
8 :     = X.F1;
9 :    
10 :     functor F =
11 :     let val lr = ref []
12 :     in H(struct
13 :     functor F1 (type t) =
14 :     struct
15 :     (* t -> unit *)
16 :     fun put (x : t) = lr := [x]
17 :    
18 :     (* unit -> t *)
19 :     fun get () = hd(!lr)
20 :    
21 :     end (* functor F *)
22 :     end)
23 :     end; (* let fctexp *)
24 :    
25 :     structure A = F(type t = unit -> unit);
26 :     structure B = F(type t = bool);
27 :    
28 :     val x = B.put true;
29 :     val y = (A.get ()) ();
30 :    

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0