caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Daniel de Rauglaudre <daniel.de_rauglaudre@inria.fr>
To: Caml List <caml-list@inria.fr>
Subject: Re: [Caml-list] Camlp4s 4.02
Date: Tue, 10 Jul 2007 13:13:29 +0200	[thread overview]
Message-ID: <20070710111329.GA7621@yquem.inria.fr> (raw)
In-Reply-To: <1184058519.14689.8.camel@rosella.wigram>

Hi,

On Tue, Jul 10, 2007 at 07:08:39PM +1000, skaller wrote:
> >     #load "fred.cmo";
> 
> yes, but it only works in the top level, where it is a burden.
> It doesn't work where it is actually needed: batch compilation.

Yes, it does ! It has the same syntax than in the toplevel because it
has the same semantics : loading. In batch compilation, it means
"load in the preprocessor context".

> besides .. that command does dynamic loading, which is not
> the same as specifying a syntax.

I am sorry, but do you know that when you use "open Module" in a file,
the file "module.cmi" is "dynamically loaded" in ocamlc ? Ok, this is
not code, but it is the same idea: loading something in the compiler
to change its behaviour.

If you don't like the syntax "#load", ok, but the semantics is correct
and fully consistent with the same one in the toplevel.

> For dynamic loading the syntax is evil: the .cmo should not be
> required

This is not evil, this is great ! All the principle of camlp4 is that
syntax extensions are code previously compiled (therefore compilable)
and loaded in the preprocessor.

Well, if you want to "hide" that to the user, ok, but it is a problem
of "shell", not a problem of "kernel". Camlp4 is good in its fundamental
principles.

And I defend the idea that syntax extensions are loaded code. This is
Michel Mauny's basic idea and I agree with him. It is a the beauty of
camlp4.

> (it could be native code loading native code .. :)

It cannot be native code, because camlp4 uses only bytecode, and
the "#load" being done in the preprocessor, there is no difference
whether you compile your file by ocamlc or ocamlopt.

This "#load" does not mean "load in the program" but "load in the
preprocessor". This is a *directive*, indicating clearly that it is
information for the compiler, not for the user program.

-- 
Daniel de Rauglaudre
http://pauillac.inria.fr/~ddr/


  parent reply	other threads:[~2007-07-10 11:13 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-09  9:40 Daniel de Rauglaudre
2007-07-09  9:58 ` [Caml-list] " Joel Reymont
2007-07-09 11:28   ` skaller
2007-07-10  8:33     ` Daniel de Rauglaudre
2007-07-10  9:08       ` skaller
2007-07-10  9:38         ` Olivier Andrieu
2007-07-10 13:19           ` Nicolas Pouillard
2007-07-10 11:13         ` Daniel de Rauglaudre [this message]
2007-07-10 13:05           ` skaller
2007-07-10 13:53             ` Daniel de Rauglaudre
2007-07-09 11:51   ` Richard Jones
2007-07-10 11:32 ` Stefano Zacchiroli
2007-07-10 12:19   ` Daniel de Rauglaudre
2007-07-10 12:33     ` Stefano Zacchiroli
2007-07-10 15:04       ` [Caml-list] Camlp4s 4.02 -> 4.03 Daniel de Rauglaudre
2007-07-10 15:08         ` Stefano Zacchiroli
2007-07-10 22:39           ` Markus E.L.
2007-07-10 23:30             ` [Caml-list] camlp4..camlp5 Daniel de Rauglaudre
2007-07-11  6:45               ` Stefano Zacchiroli
2007-07-11 10:54                 ` Markus E.L.
2007-07-11 16:11                 ` Daniel de Rauglaudre
2007-07-11 10:52               ` Markus E.L.
2007-07-11  7:52             ` [Caml-list] Camlp4s 4.02 -> 4.03 Nicolas Pouillard
2007-07-10 15:17         ` skaller
2007-07-10 15:46           ` Till Varoquaux
2007-07-10 15:58             ` skaller
2007-07-10 16:08               ` Till Varoquaux
2007-07-10 16:46                 ` skaller
2007-07-10 13:12     ` [Caml-list] Camlp4s 4.02 skaller
2007-07-10 13:54       ` Daniel de Rauglaudre
2007-07-10 14:40     ` Yitzhak Mandelbaum

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=20070710111329.GA7621@yquem.inria.fr \
    --to=daniel.de_rauglaudre@inria.fr \
    --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;
as well as URLs for NNTP newsgroup(s).