caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] smarter #load directive
@ 2013-05-13  1:48 Francois Berenger
  2013-05-13  2:23 ` Francois Berenger
  0 siblings, 1 reply; 5+ messages in thread
From: Francois Berenger @ 2013-05-13  1:48 UTC (permalink / raw)
  To: caml-list

Hello,

Was this integrated in the subversion trunk?

I mean the
#load "toto.ml";;
that creates a Toto module automatically.

Thanks a lot,
F.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Caml-list] smarter #load directive
  2013-05-13  1:48 [Caml-list] smarter #load directive Francois Berenger
@ 2013-05-13  2:23 ` Francois Berenger
  2013-05-13  6:21   ` Gabriel Scherer
  0 siblings, 1 reply; 5+ messages in thread
From: Francois Berenger @ 2013-05-13  2:23 UTC (permalink / raw)
  To: caml-list

On 05/13/2013 10:48 AM, Francois Berenger wrote:
> Hello,
>
> Was this integrated in the subversion trunk?
>
> I mean the
> #load "toto.ml";;
> that creates a Toto module automatically.

Or was it '#use "toto.ml";;' ?

> Thanks a lot,
> F.
>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Caml-list] smarter #load directive
  2013-05-13  2:23 ` Francois Berenger
@ 2013-05-13  6:21   ` Gabriel Scherer
  2013-05-13 22:22     ` Gerd Stolpmann
  2013-05-13 22:22     ` Gerd Stolpmann
  0 siblings, 2 replies; 5+ messages in thread
From: Gabriel Scherer @ 2013-05-13  6:21 UTC (permalink / raw)
  To: Francois Berenger; +Cc: caml-list

Following the caml-list discussion, and PR submission #5825 by
Grégoire Henry (with a patch!), the directive #mod_use "foo.ml" was
added in trunk last November.

It does not correspond to "load" because the module is not compiled
using ocamlc (no .cmo is produced), but compiled by the toplevel in
the current toplevel environment. The current implementation is a bit
hackish, I think, and in particular toplevel directives are not
allowed inside foo.ml -- I think they even are silently dropped. It
behaves exactly as if you entered "module Foo = <content of foo.ml
(minus toplevel directives)> end;;" directly in the toplevel.

On Mon, May 13, 2013 at 4:23 AM, Francois Berenger <berenger@riken.jp> wrote:
> On 05/13/2013 10:48 AM, Francois Berenger wrote:
>>
>> Hello,
>>
>> Was this integrated in the subversion trunk?
>>
>> I mean the
>> #load "toto.ml";;
>> that creates a Toto module automatically.
>
>
> Or was it '#use "toto.ml";;' ?
>
>
>> Thanks a lot,
>> F.
>>
>
>
> --
> Caml-list mailing list.  Subscription management and archives:
> https://sympa.inria.fr/sympa/arc/caml-list
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Caml-list] smarter #load directive
  2013-05-13  6:21   ` Gabriel Scherer
@ 2013-05-13 22:22     ` Gerd Stolpmann
  2013-05-13 22:22     ` Gerd Stolpmann
  1 sibling, 0 replies; 5+ messages in thread
From: Gerd Stolpmann @ 2013-05-13 22:22 UTC (permalink / raw)
  To: Gabriel Scherer; +Cc: Francois Berenger, caml-list


> Following the caml-list discussion, and PR submission #5825 by
> Grégoire Henry (with a patch!), the directive #mod_use "foo.ml" was
> added in trunk last November.
>
> It does not correspond to "load" because the module is not compiled
> using ocamlc (no .cmo is produced), but compiled by the toplevel in
> the current toplevel environment. The current implementation is a bit
> hackish, I think, and in particular toplevel directives are not
> allowed inside foo.ml -- I think they even are silently dropped. It
> behaves exactly as if you entered "module Foo = <content of foo.ml
> (minus toplevel directives)> end;;" directly in the toplevel.

So far I remember, this is the intended meaning. Directives do not make
sense inside modules. If they are not rejected, I'd consider this as an
error, though.

Gerd

> On Mon, May 13, 2013 at 4:23 AM, Francois Berenger <berenger@riken.jp>
> wrote:
>> On 05/13/2013 10:48 AM, Francois Berenger wrote:
>>>
>>> Hello,
>>>
>>> Was this integrated in the subversion trunk?
>>>
>>> I mean the
>>> #load "toto.ml";;
>>> that creates a Toto module automatically.
>>
>>
>> Or was it '#use "toto.ml";;' ?
>>
>>
>>> Thanks a lot,
>>> F.
>>>
>>
>>
>> --
>> Caml-list mailing list.  Subscription management and archives:
>> https://sympa.inria.fr/sympa/arc/caml-list
>> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
>> Bug reports: http://caml.inria.fr/bin/caml-bugs
>
> --
> Caml-list mailing list.  Subscription management and archives:
> https://sympa.inria.fr/sympa/arc/caml-list
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs
>


-- 
Gerd Stolpmann, Darmstadt, Germany    gerd@gerd-stolpmann.de
Creator of GODI and camlcity.org.
Contact details:        http://www.camlcity.org/contact.html


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Caml-list] smarter #load directive
  2013-05-13  6:21   ` Gabriel Scherer
  2013-05-13 22:22     ` Gerd Stolpmann
@ 2013-05-13 22:22     ` Gerd Stolpmann
  1 sibling, 0 replies; 5+ messages in thread
From: Gerd Stolpmann @ 2013-05-13 22:22 UTC (permalink / raw)
  To: Gabriel Scherer; +Cc: Francois Berenger, caml-list


> Following the caml-list discussion, and PR submission #5825 by
> Grégoire Henry (with a patch!), the directive #mod_use "foo.ml" was
> added in trunk last November.
>
> It does not correspond to "load" because the module is not compiled
> using ocamlc (no .cmo is produced), but compiled by the toplevel in
> the current toplevel environment. The current implementation is a bit
> hackish, I think, and in particular toplevel directives are not
> allowed inside foo.ml -- I think they even are silently dropped. It
> behaves exactly as if you entered "module Foo = <content of foo.ml
> (minus toplevel directives)> end;;" directly in the toplevel.

So far I remember, this is the intended meaning. Directives do not make
sense inside modules. If they are not rejected, I'd consider this as an
error, though.

Gerd

> On Mon, May 13, 2013 at 4:23 AM, Francois Berenger <berenger@riken.jp>
> wrote:
>> On 05/13/2013 10:48 AM, Francois Berenger wrote:
>>>
>>> Hello,
>>>
>>> Was this integrated in the subversion trunk?
>>>
>>> I mean the
>>> #load "toto.ml";;
>>> that creates a Toto module automatically.
>>
>>
>> Or was it '#use "toto.ml";;' ?
>>
>>
>>> Thanks a lot,
>>> F.
>>>
>>
>>
>> --
>> Caml-list mailing list.  Subscription management and archives:
>> https://sympa.inria.fr/sympa/arc/caml-list
>> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
>> Bug reports: http://caml.inria.fr/bin/caml-bugs
>
> --
> Caml-list mailing list.  Subscription management and archives:
> https://sympa.inria.fr/sympa/arc/caml-list
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs
>


-- 
Gerd Stolpmann, Darmstadt, Germany    gerd@gerd-stolpmann.de
Creator of GODI and camlcity.org.
Contact details:        http://www.camlcity.org/contact.html


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-05-13 22:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-13  1:48 [Caml-list] smarter #load directive Francois Berenger
2013-05-13  2:23 ` Francois Berenger
2013-05-13  6:21   ` Gabriel Scherer
2013-05-13 22:22     ` Gerd Stolpmann
2013-05-13 22:22     ` Gerd Stolpmann

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