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

SCM Repository

[smlnj] View of /tests/trunk/bugs/tests.obsolete/bug202.1.sml
ViewVC logotype

View of /tests/trunk/bugs/tests.obsolete/bug202.1.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2460 - (download) (annotate)
Sat Apr 28 20:18:10 2007 UTC (12 years, 2 months ago) by gkuan
File size: 660 byte(s)
(* bug202.1.sml *)

datatype 'a chan = CHAN of 'a

signature BADGUYS = sig
    val mkchan : unit -> '1a chan
    val ufanout : '2a chan * '2a chan list -> 'b
    val begin_str :  string -> ('a -> 'b) -> 'a -> unit
end

signature WONKY =  sig
    val ureplicas : int -> '2a chan -> '6b chan list
		(* wrong! should be int -> '2a chan -> '2a chan list *)
  end

functor buggy(bad:BADGUYS):WONKY = struct

open bad

fun ureplicas n c =     (* n unsynchronized copies of channel c *)
    let fun channels(l,0) = l
	  | channels(l,n) = channels(mkchan()::l,n-1)
	val chans = channels(nil,n)
	val _ = begin_str "replicas" ufanout(c,chans)
    in  chans
    end

end

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