caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Sven <luther@dpt-info.u-strasbg.fr>
To: David Mentre <David.Mentre@inria.fr>
Cc: Vesa Karvonen <vesa.karvonen@housemarque.fi>, caml-list@inria.fr
Subject: Re: [Caml-list] line number for assert
Date: Tue, 11 Sep 2001 12:53:25 +0200	[thread overview]
Message-ID: <20010911125325.A29665@dpt-info.u-strasbg.fr> (raw)
In-Reply-To: <qtln142ys09.fsf@pochi.inria.fr>; from David.Mentre@inria.fr on Tue, Sep 11, 2001 at 11:51:50AM +0200

On Tue, Sep 11, 2001 at 11:51:50AM +0200, David Mentre wrote:
> "Vesa Karvonen" <vesa.karvonen@housemarque.fi> 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:
>   http://caml.inria.fr/archives/200011/msg00032.html
> 
> > 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.

What about a little tool to be added to the ocaml distribution, which parses a
file, and convert the char number to line number + column. I guess, from what
is already done by the toplevel, that this would be trivial to implement, as
all the code for it is already written.

Friendly,

Sven Luther
-------------------
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


  parent reply	other threads:[~2001-09-11 10:52 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-09-11  9:39 Vesa Karvonen
2001-09-11  9:51 ` David Mentre
2001-09-11 10:06   ` Markus Mottl
2001-09-13  0:14     ` SooHyoung Oh
2001-09-13  8:46       ` Markus Mottl
2001-09-11 10:53   ` Sven [this message]
2001-09-11 13:49     ` Christian Lindig
2001-09-11 14:41   ` Vesa Karvonen

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=20010911125325.A29665@dpt-info.u-strasbg.fr \
    --to=luther@dpt-info.u-strasbg.fr \
    --cc=David.Mentre@inria.fr \
    --cc=caml-list@inria.fr \
    --cc=vesa.karvonen@housemarque.fi \
    /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).