caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Revised syntax error messages ?
@ 2008-02-05 12:45 David Teller
  2008-02-05 13:35 ` [Caml-list] " Nicolas Pouillard
  0 siblings, 1 reply; 2+ messages in thread
From: David Teller @ 2008-02-05 12:45 UTC (permalink / raw)
  To: Caml

   Hi everyone,
 At the moment, when using the revised syntax, the toplevel prints
typing error messages with the revised syntax but ocamlc seems to print
them with the original syntax, which may be confusing.

For instance, in the toplevel :

# match [] with [ Some _ -> 1 | None -> 2 ];
                       ^
This pattern matches values of type option 'a
but is here used to match values of type list 'b


With ocamlc :

yoric@Blefuscu:/tmp$ ocamlc -pp camlp4rf test.ml 
File "test.ml", line 1, characters 21-22:
This pattern matches values of type 'a option
but is here used to match values of type 'b list

This may be quite confusing for beginners. Is there a way to get the
revised syntax error messages with ocamlc ?

Thanks,
 David

-- 
David Teller
 Security of Distributed Systems
  http://www.univ-orleans.fr/lifo/Members/David.Teller
 Angry researcher: French Universities need reforms, but the LRU act brings liquidations. 


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

* Re: [Caml-list] Revised syntax error messages ?
  2008-02-05 12:45 Revised syntax error messages ? David Teller
@ 2008-02-05 13:35 ` Nicolas Pouillard
  0 siblings, 0 replies; 2+ messages in thread
From: Nicolas Pouillard @ 2008-02-05 13:35 UTC (permalink / raw)
  To: david.teller; +Cc: caml-list

[-- Attachment #1: Type: text/plain, Size: 301 bytes --]

Excerpts from david.teller's message of Tue Feb 05 13:45:01 +0100 2008:
>    Hi everyone,
Hi,

[...]

> Is there a way to get the
> revised syntax error messages with ocamlc ?

Currently no, and this would be a somewhat intrusive and extensive change to the compiler.

-- 
Nicolas Pouillard aka Ertai

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 232 bytes --]

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

end of thread, other threads:[~2008-02-05 13:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-05 12:45 Revised syntax error messages ? David Teller
2008-02-05 13:35 ` [Caml-list] " Nicolas Pouillard

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