[racket] how to get line numbers on syntax errors on load?

From: Thomas Lynch (thomas.lynch at reasoningtechnology.com)
Date: Tue Mar 10 01:12:34 EDT 2015

It is scary to run regression on over ten thousand lines of code and then
racket spits out error messages but does not give source file location
information, as above.   So if anyone has an answer for this I would like
to hear it.

FYI,  in this particular case,  test-hook was defined lower in the
basic-lib.rkt than its first invocation - though at top level of the
module.  Not sure why this scenario fails here, now, but the test-hook
definition was easily moved up.  The error messaged mentioned test-hook,
but that was practically meaningless as every regression routine has one.
... It had nothing to do with macros or unicode as first thought.



On Tue, Mar 10, 2015 at 12:44 PM, Thomas Lynch <
thomas.lynch at reasoningtechnology.com> wrote:

> When loading modules I sometimes get syntax errors - rightfully so.
> However, the errors sometimes don't have line numbers, making them time
> consuming to find.
>
> Here is one today:
>
> Welcome to Racket v5.2.1.
> racket@> (enter! "ap.rkt")
> link: reference (phase 0) to a variable in module "basic-lib.rkt" that is
> uninitialized (phase level 0); reference appears in module: "realtime.rkt"
> in: test-hook
>
>
>
> Which variable?  Which line in which file?
>
> This is old code that is not playing well within a new environment. There
> are thousands of combinations possible against this information.   .. I
> suspect this has to do with using unicode characters, specifically lambda,
> within macros, if so it will not be long to find it.  However, in the worse
> case I will have to start a binary search cutting out blocks of code, and
> inserting stub routines .. but this is time consuming, and this sort of
> vague message is not a one time occurrence.
>
> Is there a way to coerce racket to be more specific in its messages?
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20150310/5a471dca/attachment-0001.html>

Posted on the users mailing list.