caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] The rec/nonrec debate
@ 2013-05-20 14:31 Dario Teixeira
  2013-05-20 14:38 ` David House
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Dario Teixeira @ 2013-05-20 14:31 UTC (permalink / raw)
  To: OCaml mailing-list

Hi,


As you know, there is in OCaml some asymmetry regarding the rec/nonrec 
defaults for type and value declarations.  Types are recursive by default
and there's no way to "unrecurse" them, whereas values are by default not
recursive and can be made recursive via the "rec" keyword.

The unrecursiveness of type declarations is cause for some chagrin, as a 
recent ticket on Mantis demonstrates [1].

Here's something I wonder: if one were to wipe the slate clean, is there 
consensus among the community about the best defaults?  I'm leaning towards
having nonrec as the default behaviour for *both* types and values, and
using "rec" as the keyword for recursive types and values.  This scheme
would obviate the need for an actual "nonrec" keyword.

Obviously, such a change would be too intrusive to make to OCaml.  However, 
since people are working on "Next Generation ML" languages like Mezzo [2],
I think it would be good to get the community's pulse on this subject.
(Btw, from the examples posted on Mezzo's homepage, it seems to use the
same defaults as OCaml).

Your thoughts?

Best regards,
Dario Teixeira

[1] http://caml.inria.fr/mantis/view.php?id=6016
[2] http://gallium.inria.fr/~protzenk/mezzo-lang/


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2013-05-21 15:14 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-20 14:31 [Caml-list] The rec/nonrec debate Dario Teixeira
2013-05-20 14:38 ` David House
2013-05-20 15:18   ` Julien Blond
2013-05-20 15:19     ` David House
2013-05-20 16:18     ` Dario Teixeira
2013-05-21 14:22       ` Richard W.M. Jones
2013-05-21 15:14         ` Dario Teixeira
2013-05-20 15:17 ` Török Edwin
2013-05-20 16:05   ` Dario Teixeira
2013-05-21  4:07 ` [Caml-list] " Hongbo Zhang
2013-05-21  8:25 ` [Caml-list] " Alain Frisch
2013-05-21 11:15   ` Boris Yakobowski

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).