caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Type declaration question
@ 2001-11-01 15:31 Krishnaswami, Neel
  0 siblings, 0 replies; only message in thread
From: Krishnaswami, Neel @ 2001-11-01 15:31 UTC (permalink / raw)
  To: caml-list

Hello,

I'm wondering why record declarations can't be part of a regular
variant type declaration. Eg, is there a special reason that this
is illegal:

type expr = 
  | Fun of {formal: string; body: expr}
  | App of {func: expr; arg: expr}

and I must write: 

type expr = 
  | Fun of fun_expr
  | App of app_expr
and fun_expr = {formal: string; body: expr}
and app_expr = {func: expr; arg: expr}

IIRC the first version is ok in SML. Why the difference in Caml?

--
Neel Krishnaswami
neelk@cswcasa.com
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2001-11-01 15:27 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-11-01 15:31 [Caml-list] Type declaration question Krishnaswami, Neel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).