* 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