caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Anil Madhavapeddy <anil@recoil.org>
To: Jeremy Yallop <yallop@gmail.com>
Cc: Philippe Veber <philippe.veber@gmail.com>,
	caml users <caml-list@inria.fr>
Subject: Re: [Caml-list] Strange camlp4 issue
Date: Mon, 1 Oct 2012 15:45:10 -0700	[thread overview]
Message-ID: <5149DC70-C455-4BA1-AE3F-8A8CC5B6111C@recoil.org> (raw)
In-Reply-To: <CAAxsn=FaQ5toyuLB4Y2=uc3aZV05KtgOmxS7jdxGfi9SYUNniA@mail.gmail.com>

Another reason it might be going wrong is that your quotations are
generating invalid ASTs. This can happen when using the original syntax
quotations (which are more ambiguous than the revised syntax).

To get around this sort of problem, I tend to use the 'camlp4orf' variant,
which uses the original syntax as the host language, and revised syntax for
quotations.  This will mean that you need to learn the revised syntax for
the sole goal of writing quotations, but it is actually quite pleasant to
use (and certainly more fun than staring at dumps of raw AST fragments).

-anil

On 1 Oct 2012, at 15:39, Jeremy Yallop <yallop@gmail.com> wrote:

> Dear Philippe,
> 
> On 1 October 2012 17:21, Philippe Veber <philippe.veber@gmail.com> wrote:
>>                    let _ = (a7818b19c#compound : Rbase.compound 'abdf89974)
> 
> This appears to be the line where things are going wrong.
> Rbase.compound 'abdf89974 is not a valid type in original (i.e.
> standard) OCaml syntax, but is valid in the revised syntax.  It may be
> that you're using the wrong camlp4 executable somewhere along the
> line: for example, using quotations for revised syntax in your
> extension, but building the extension using an original-syntax based
> executable such as camlp4o.  There's a handy guide to the various
> camlp4 executables on the wiki:
> 
> http://brion.inria.fr/gallium/index.php/Using_Camlp4#Camlp4_executables_functionalities
> 
> You're seeing different error-reporting behaviour depending on whether
> you redirect the file because camlp4 checks whether it's printing to a
> terminal when deciding whether to print textual or binary output by
> default:
> 
> http://caml.inria.fr/svn/ocaml/trunk/camlp4/Camlp4Printers/Camlp4AutoPrinter.ml
> 
> Hope that helps a bit,
> 
> Jeremy.
> 
> -- 
> 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
> 


  reply	other threads:[~2012-10-01 22:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-01 16:21 Philippe Veber
2012-10-01 22:39 ` Jeremy Yallop
2012-10-01 22:45   ` Anil Madhavapeddy [this message]
2012-10-02  7:21     ` Philippe Veber

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=5149DC70-C455-4BA1-AE3F-8A8CC5B6111C@recoil.org \
    --to=anil@recoil.org \
    --cc=caml-list@inria.fr \
    --cc=philippe.veber@gmail.com \
    --cc=yallop@gmail.com \
    /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).