caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: David House <dmhouse@gmail.com>
To: bluestorm <bluestorm.dylc@gmail.com>
Cc: Jeremy Bem <jeremy1@gmail.com>,
	caml-list List <caml-list@yquem.inria.fr>,
	Florian Weimer <fw@deneb.enyo.de>
Subject: Re: [Caml-list] interest in a much simpler, but modern, Caml?
Date: Mon, 9 Aug 2010 09:10:43 -0400	[thread overview]
Message-ID: <AANLkTinuqQz+9ntvwzE4pvmh5AE2D2+qXoV4SR-MLmav@mail.gmail.com> (raw)
In-Reply-To: <AANLkTimoAn8PNOW2X+eTYPQneKQertH-K__Q63mU9T7x@mail.gmail.com>

On 8 August 2010 17:47, bluestorm <bluestorm.dylc@gmail.com> wrote:
> If you don't have any of these, you have to declare infix operators
> directly inside the module. You'd have a "val (=) : int -> int ->
> bool" in the "int.ml" file for example. That's notoriously painful to
> handle if you use the "open" statement : a bunch of "open" statements
> in a non-careful order and your infix operators become unusable
> because you don't know anymore where they come from. What you really
> need is some form of "explicit open", à la Python or Haskell, such as
> "from Int import (mod, of_char, to_char)" instead of the full open :
> only a few identifiers are unqualified, and you still use Int.(=),
> Int.(+) instead of polluting the global namespace.

If you're willing to explicitly name the things you wish to import
then this doesn't seem to be a hard problem to solve:

let mod = Int.mod
let of_char = Int.of_char
let to_char = Int.tochar

Or even, in 3.12,

let mod, of_char, to_char = Int.(mod, of_char, to_char)


  parent reply	other threads:[~2010-08-09 13:10 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-06  4:04 Jeremy Bem
2010-08-06 13:50 ` [Caml-list] " Eray Ozkural
2010-08-08 17:59 ` Florian Weimer
2010-08-08 18:44   ` Jeremy Bem
2010-08-08 18:52     ` Florian Weimer
2010-08-08 19:39       ` Jeremy Bem
2010-08-09 11:55         ` Nicolas Pouillard
2010-08-11 13:00         ` Jon Harrop
2010-08-08 20:53       ` Nicolas Pouillard
2010-08-08 20:59         ` Jeremy Bem
2010-08-08 21:47           ` bluestorm
2010-08-08 23:00             ` Christophe TROESTLER
2010-08-08 23:29             ` Jeremy Bem
2010-08-11 13:02               ` Jon Harrop
2010-08-12  0:21                 ` Jeremy Bem
2010-08-12 23:14                   ` Jon Harrop
2010-08-09 13:10             ` David House [this message]
2010-08-09 14:03               ` Nicolas Pouillard
2010-08-08 20:52     ` Nicolas Pouillard
2010-08-11 12:56     ` Jon Harrop
2010-08-09  6:37 ivan chollet
2010-08-09 10:54 ` Cedric Cellier
2010-08-09 15:00 ` ivan chollet
2010-08-09 15:03 ` ivan chollet
2010-08-11 13:19 ` Jon Harrop
2010-08-11 16:12   ` philippe
2010-08-12  6:56   ` ivan chollet

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=AANLkTinuqQz+9ntvwzE4pvmh5AE2D2+qXoV4SR-MLmav@mail.gmail.com \
    --to=dmhouse@gmail.com \
    --cc=bluestorm.dylc@gmail.com \
    --cc=caml-list@yquem.inria.fr \
    --cc=fw@deneb.enyo.de \
    --cc=jeremy1@gmail.com \
    /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).