Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] line number for assert
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: David Mentre <David.Mentre@i...>
Subject: Re: [Caml-list] line number for assert
"Vesa Karvonen" <> writes:

> The assert primitive of Ocaml 3.02 (windows version) seems to print the source
> file location as an offset from the beginning of the file rather than as a
> line number and column.
> Is there a particular reason for this?

Yes. Internally, the compiler knows only about character position. The
line number is computed (in fact the source file is reparsed) only when
an error message is printed:

> The reason why I'm asking this is that it makes it much more difficult to find
> the right assertion on most editors.

Except with emacs. :)

> Is there a simple way to overcome this limitation?

As far as I know, no. However you should look at mailing list
archive. This topic has been discussed numerous times.

Best regards,
 Opinions expressed here are only mine.
Bug reports:  FAQ:
To unsubscribe, mail  Archives: