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/bug419.sml
ViewVC logotype

Annotation of /tests/trunk/bugs/tests.obsolete/bug419.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2460 - (view) (download)

1 : dbm 548 (* bug419.sml *)
2 :     (* requires CML *)
3 :    
4 :     local open CML
5 :     in
6 :     fun placeBuffer () =
7 :     let
8 :     val c = channel ()
9 :     val b = channel ()
10 :     val a = channel ()
11 :     fun input_int (s:string) =
12 :     fold (fn(a,r) => ord(a) - ord("0") + 10 * r) (tl (rev(explode s))) 0;
13 :    
14 :     fun P1 x = (CIO.print( "Waiting for Input on Channel a? \n");
15 :     let
16 :     val y = input_int(CIO.input_line CIO.std_in)
17 :     in
18 :     s__3 x y
19 :     end)
20 :     and
21 :     s__3 x y = ( ( send (c,y ) ; P1 y ))
22 :    
23 :     fun P2 z = (let val v = accept c in s__5 z v end)
24 :     and
25 :     s__5 z v =
26 :     ( (CIO.print (" Output on Channel b!"^Integer.makestring(v)^"\n");
27 :     P2 v ))
28 :     in
29 :     spawn (fn () => P1 4 );
30 :     spawn (fn () => P2 5 );
31 :     ()
32 :     end
33 :     end (* local *)

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