Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] Style question
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Brian Rogoff <bpr@b...>
Subject: Re: [Caml-list] Style question
On Tue, 11 Sep 2001, Andreas Rossberg wrote:
> Brian Rogoff wrote:
> >
> > It seems to me that all of the uses of local in SML can be handled can be
> > handled by the module system in OCaml, and I don't even find the unsugared
> > forms to be bad at all.
> It is not exactly sugar since you can express things with local that you
> cannot with signatures - but all of them are pretty useless.

I've only seen some of the more bizarre uses (like coding dynamics using
"polymorphic" local exceptions) as stupid pet tricks. But I've read lot's
of SML code that makes heavy use of local to hide function names. I almost
never see an abstype.

> My personal opinion is that using modules is preferable even in SML,
> its local being an anachronism from the pre-module days, just like
> abstype. I almost never use it.

Good! Your code should port easily then.

> It only comes in handy in conjunction with open:

Right, but I assume you know the workaround, since you decribe it in a
followup, and I assume you've read this page

I just wish the author would update the section on localdecs to mention
using modules instead of local open :-)

-- Brian

> 	local open M in
> 	...
> 	end
> Of course, in OCaml this is solved by having open vs. include.
> 	- Andreas
> --
> Andreas Rossberg,
> "Computer games don't affect kids; I mean if Pac Man affected us
>  as kids, we would all be running around in darkened rooms, munching
>  magic pills, and listening to repetitive electronic music."
>  - Kristian Wilson, Nintendo Inc.
> -------------------
> Bug reports:  FAQ:
> To unsubscribe, mail  Archives:

Bug reports:  FAQ:
To unsubscribe, mail  Archives: