On Mon, Jan 31, 2005 at 11:08:52AM -0500, Jonathan S. Shapiro wrote: > On Mon, 2005-01-31 at 07:30 -0500, Swaroop Sridhar wrote: > > Jonathan S. Shapiro wrote: > > > > > > > >I think that we agree. In fact, with polymorphism restored, the > > >differences between BitC and O'Caml are basically the following: > > > > > > Explicitly declarable boxed/unboxed types > > > Greater range of fixed-precision integer types. > > > > > 3 more: > > datatype and record definitions create unique types > > function arguments cannot be defined to take value patterns > > recursive data definitions are not allowed > > I was unclear. I was referring to differences in the underlying > semantics. > > Does ML actually allow recursive data definitions? This would be very > surprising if true... > The O'Caml language permits recursive data definitions, when the option -rectypes is given. There was/is just a discussion about this on the O'Caml mailing list, and there are no theoretical problems with recursive data definitions, but the type inference engine infers weird types for cases that otherwise would be discovered as errors, and then even weirder error messages appear when using the functions.
(* with -rectypes *) type t = t option (* without -rectypes *) type t = Some of t | None (* Sample session from interactive toplevel for O'Caml *) #ocamli -rectypes Objective Caml version 3.08.2 # type t = t option;; type t = t option # let (x:t) = None;; val x : t = None # let (x:t) = Some (Some x);; val x : t = Some (Some None) -- Sincerely | Homepage: J�rgen | http://www.hex.no/jhf | Public GPG key: | http://www.hex.no/jhf/key.txt
signature.asc
Description: Digital signature
_______________________________________________ bitc-dev mailing list [email protected] http://www.coyotos.org/mailman/listinfo/bitc-dev
