caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] -unsafe and camlp4
@ 2003-07-08 12:49 "Dmitry Bely" 
  2003-07-08 13:38 ` Xavier Leroy
  0 siblings, 1 reply; 4+ messages in thread
From: "Dmitry Bely"  @ 2003-07-08 12:49 UTC (permalink / raw)
  To: caml-list

Can two things live together? When I run ocamlopt -unsafe -pp "camlp4 ..." ..., compiler prints warning and -unsafe seems to be ignored. Am I doing something wrong?

-- Dmitry Bely

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


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

* Re: [Caml-list] -unsafe and camlp4
  2003-07-08 12:49 [Caml-list] -unsafe and camlp4 "Dmitry Bely" 
@ 2003-07-08 13:38 ` Xavier Leroy
  2003-07-08 15:38   ` [Caml-list] camlp4 Dmitry Bely
  0 siblings, 1 reply; 4+ messages in thread
From: Xavier Leroy @ 2003-07-08 13:38 UTC (permalink / raw)
  To: "Dmitry Bely" ; +Cc: caml-list

> Can two things live together? When I run ocamlopt -unsafe -pp
> "camlp4 ..." ..., compiler prints warning and -unsafe seems to be
> ignored. Am I doing something wrong?

"-unsafe" is a parsing-time option: it governs how the .[] and .()
notations are parsed into applications of functions from the Array and
String modules.  Hence, if you use camlp4 for parsing, you should pass
the -unsafe option to camlp4, not to ocamlc/ocamlopt.

- Xavier Leroy

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


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

* Re: [Caml-list] camlp4
  2003-07-08 13:38 ` Xavier Leroy
@ 2003-07-08 15:38   ` Dmitry Bely
  2003-07-22 11:14     ` Damien Doligez
  0 siblings, 1 reply; 4+ messages in thread
From: Dmitry Bely @ 2003-07-08 15:38 UTC (permalink / raw)
  To: Xavier Leroy; +Cc: caml-list

Xavier Leroy <xavier.leroy@inria.fr> writes:

>> Can two things live together? When I run ocamlopt -unsafe -pp
>> "camlp4 ..." ..., compiler prints warning and -unsafe seems to be
>> ignored. Am I doing something wrong?
>
> "-unsafe" is a parsing-time option: it governs how the .[] and .()
> notations are parsed into applications of functions from the Array and
> String modules.  Hence, if you use camlp4 for parsing, you should pass
> the -unsafe option to camlp4, not to ocamlc/ocamlopt.

Ah, I see. thank you very much.

There is another problem with camlp4. When it reports syntax error, it
doesn't count the lines, say:

File "test.ml", line 1, characters 12398-12401:
<...>

(line is always equal to 1, at least under Windows)

I compile Ocaml sources within XEmacs/Win32/tuareg mode, and Emacs consider
EOL in the buffer as ONE character, while camlp4 counts it as TWO chars. So
the error place is pointed incorrectly.

How do you think, where it could be fixed? (camlp4, tuareg,...)?

- Dmitry Bely


-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


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

* Re: [Caml-list] camlp4
  2003-07-08 15:38   ` [Caml-list] camlp4 Dmitry Bely
@ 2003-07-22 11:14     ` Damien Doligez
  0 siblings, 0 replies; 4+ messages in thread
From: Damien Doligez @ 2003-07-22 11:14 UTC (permalink / raw)
  To: Dmitry Bely; +Cc: caml-list

On Tuesday, July 8, 2003, at 05:38 PM, Dmitry Bely wrote:

> There is another problem with camlp4. When it reports syntax error, it
> doesn't count the lines, say:
>
> File "test.ml", line 1, characters 12398-12401:
> <...>
>
> (line is always equal to 1, at least under Windows)
>
> I compile Ocaml sources within XEmacs/Win32/tuareg mode, and Emacs 
> consider
> EOL in the buffer as ONE character, while camlp4 counts it as TWO 
> chars. So
> the error place is pointed incorrectly.
>
> How do you think, where it could be fixed? (camlp4, tuareg,...)?

It needs to be fixed in camlp4. It will need a non-trivial amount
of work, so it will be done only after release 3.07.

In the meantime, you could try to convince emacs that CR LF is really
two characters, not one.

-- Damien

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


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

end of thread, other threads:[~2003-07-22 11:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-08 12:49 [Caml-list] -unsafe and camlp4 "Dmitry Bely" 
2003-07-08 13:38 ` Xavier Leroy
2003-07-08 15:38   ` [Caml-list] camlp4 Dmitry Bely
2003-07-22 11:14     ` Damien Doligez

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