From: David Allsopp <dra-news@metastack.com>
To: caml users <caml-list@inria.fr>
Subject: RE: [Caml-list] Operator for Lazy.force?
Date: Sat, 2 Nov 2013 19:03:53 +0000 [thread overview]
Message-ID: <E51C5B015DBD1348A1D85763337FB6D9DB7B45E3@Remus.metastack.local> (raw)
In-Reply-To: <41ECAD85-CC65-41A5-AD6E-21F4B85C932D@inria.fr>
Damien Doligez wrote:
> On 2013-10-30, at 22:33, Dmitry Grebeniuk wrote:
>
> > So theirs ( !! ) operator will override Pervasives' one.
> > What's the problem? Anyway projects you've mentioned don't use Lazy,
> > so there's no chance of "operator clash".
>
> It cannot be in Pervasives, since that would introduce a circular
> dependency with Lazy. It doesn't belong in Pervasives anyway.
Out of belligerent curiosity only, is that definitely true? lazy.mli doesn't create an opaque type for 'a Lazy.t so wouldn't
external ( !! ) : 'a lazy_t -> 'a = "%lazy_force"
in pervasives.ml/mli work out of the box and to all intents and purposes have the right effect?
Even if you wanted to have the neater type 'a Lazy.t -> 'a, lazy.ml only refers to a handful of trivial externals and constants in obj.ml and only requires ( <> ) and ( || ) from Pervasives. Isn't it the case that as Pervasives would then only refer to a *type* in Lazy that you wouldn't have the (presumably unwanted) side-effect of even "Hello World" being linked with Lazy?
So either with some very minor internal code duplication (or a bit of pre-processing), is there anything else which means that you couldn't add that declaration to Pervasives without the circular dependency?
I agree that it probably doesn't belong there (although I can see the other side, given that the lazy keyword is, um, "pervasive") - just curious as to if it's possible :o)
David
prev parent reply other threads:[~2013-11-02 19:03 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-30 18:51 Lukasz Stafiniak
2013-10-30 21:07 ` Dario Teixeira
2013-10-30 21:33 ` Dmitry Grebeniuk
2013-10-31 11:10 ` Dario Teixeira
2013-11-01 15:49 ` Damien Doligez
2013-11-02 19:03 ` David Allsopp [this message]
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=E51C5B015DBD1348A1D85763337FB6D9DB7B45E3@Remus.metastack.local \
--to=dra-news@metastack.com \
--cc=caml-list@inria.fr \
/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