Version française
Home     About     Download     Resources     Contact us    
Browse thread
interest in a much simpler, but modern, Caml?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Nicolas Pouillard <nicolas.pouillard@g...>
Subject: Re: [Caml-list] interest in a much simpler, but modern, Caml?
On Mon, 9 Aug 2010 09:10:43 -0400, David House <dmhouse@gmail.com> wrote:
> 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

You may want to import types, data constructors, exceptions, modules as
well... While some of them can be mitigated data constructors cannot AFAIK.

-- 
Nicolas Pouillard
http://nicolaspouillard.fr