caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Brian Rogoff <bpr@best.com>
To: Andreas Rossberg <rossberg@ps.uni-sb.de>
Cc: <caml-list@inria.fr>
Subject: Re: [Caml-list] Style question
Date: Tue, 11 Sep 2001 11:11:21 -0700 (PDT)	[thread overview]
Message-ID: <20010911094011.D12328-100000@shell5.ba.best.com> (raw)
In-Reply-To: <3B9DE076.568458F9@ps.uni-sb.de>

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

  http://www.ps.uni-sb.de/~rossberg/SMLvsOcaml.html


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

-- Brian


http://www.ps.uni-sb.de/~rossberg/SMLvsOcaml.html#localdecs

>
> 	local open M in
> 	...
> 	end
>
> Of course, in OCaml this is solved by having open vs. include.
>
> 	- Andreas
>
> --
> Andreas Rossberg, rossberg@ps.uni-sb.de
>
> "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: 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
>

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


  parent reply	other threads:[~2001-09-11 18:12 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-09-09 21:00 Brian Rogoff
2001-09-11  9:59 ` Andreas Rossberg
2001-09-11 10:55   ` Sven
2001-09-11 12:08     ` Andreas Rossberg
2001-09-11 12:16       ` Sven
2001-09-11 14:28         ` Brian Rogoff
2001-09-11 14:29         ` Andreas Rossberg
2001-09-11 18:11   ` Brian Rogoff [this message]
2001-09-12  9:03     ` Andreas Rossberg
2001-09-11 18:58 Krishnaswami, Neel
2001-09-12  9:14 ` Andreas Rossberg
2001-09-12 10:24 Dave Berry

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20010911094011.D12328-100000@shell5.ba.best.com \
    --to=bpr@best.com \
    --cc=caml-list@inria.fr \
    --cc=rossberg@ps.uni-sb.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).