caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Questions about #use
@ 2002-02-08 21:00 Harrison, John R
  2002-02-09 10:21 ` Daniel de Rauglaudre
  0 siblings, 1 reply; 2+ messages in thread
From: Harrison, John R @ 2002-02-08 21:00 UTC (permalink / raw)
  To: 'caml-list@inria.fr'; +Cc: Harrison, John R, 'johnh

The documentation for the "#use" directive says "phrases are processed just
as if they were typed on standard input". However according to my
experience with OCaml, this isn't really accurate. Some level of syntax
checking is first done on the whole file before any phrases are processed.
For example, a syntax error on the last line will prevent any phrases from
being fully processed.

I'd like a function that does indeed display the behaviour implied by the
documentation, i.e. handles the toplevel phrases successively. Is this
easily done?

I would also like to be able to issue an analogous directive dynamically
(e.g. to read files from a program-specific search path). Since "#use"
isn't a CAML value, I can't use it. Digging around in the sources I came up
with the following, which seems to work:

  Toplevel.use_file Format.std_formatter <filename>

However, I didn't find any means of doing dynamic loading of source
mentioned in the documentation. Is the above safe or is something else
recommended?

John.
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


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

* Re: [Caml-list] Questions about #use
  2002-02-08 21:00 [Caml-list] Questions about #use Harrison, John R
@ 2002-02-09 10:21 ` Daniel de Rauglaudre
  0 siblings, 0 replies; 2+ messages in thread
From: Daniel de Rauglaudre @ 2002-02-09 10:21 UTC (permalink / raw)
  To: caml-list

Hi,

On Fri, Feb 08, 2002 at 01:00:15PM -0800, Harrison, John R wrote:

> The documentation for the "#use" directive says "phrases are processed just
> as if they were typed on standard input". However according to my
> experience with OCaml, this isn't really accurate. Some level of syntax
> checking is first done on the whole file before any phrases are processed.

If you loaded the camlp4 stuff, it is possible, indeed. There is a
serious bug in camlp4 in #use directive, a problem of order when the
file contains other directives. It has been fixed for the next version.

-- 
Daniel de RAUGLAUDRE
daniel.de_rauglaudre@inria.fr
http://cristal.inria.fr/~ddr/
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


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

end of thread, other threads:[~2002-02-09 10:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-02-08 21:00 [Caml-list] Questions about #use Harrison, John R
2002-02-09 10:21 ` Daniel de Rauglaudre

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