hyln9 / ikarus

Optimizing incremental native-code compiler for R6RS scheme. This is a forked repository.
https://launchpad.net/ikarus
Other
5 stars 0 forks source link

Better unbound variable error message #122

Open hyln9 opened 10 years ago

hyln9 commented 10 years ago

The following error message would be better if it reported "unbound variable" on "foo" instead of "baz" as the missing "foo" might be a macro which defines "baz". As it is, the user (assuming that "foo" was successfully imported) is left wondering why "foo" isn't working.

$ rlwrap ikarus Ikarus Scheme version 0.0.2-rc1+ (revision 1125, build 2007-11-24) Copyright (c) 2006-2007 Abdulaziz Ghuloum

(foo bar baz) Unhandled exception Condition components:

  1. &error
  2. &who: eval
  3. &message: "unbound variable"
  4. &irritants: (baz)

Launchpad Details: #LP164889 Michael D. Adams - 2007-11-24 12:18:22 -0500

hyln9 commented 10 years ago

This is a runtime error (in eval) so you might actually get an error in foo, bar, or baz whichever is evaluated first. If you were inside a library/script, you would've gotten an an error in foo. In your example, foo was actually successfully imported into the top-level and was given an "uninitialized" value, and so was bar and baz. That's why you'd get a conflict when you attempt to import a library that exports foo, as in bug 162785 :-)

Ikarus (usually) evaluates the operator of a procedure call after all arguments have been evaluated, and the arguments are evaluated in some order depending on the arguments themselves.

Launchpad Details: #LPC Abdulaziz Ghuloum - 2007-11-24 12:31:33 -0500

hyln9 commented 10 years ago

Marking as wontfix since, well, it won't be fixed. Please reopen if you think it should.

Launchpad Details: #LPC Abdulaziz Ghuloum - 2008-03-24 23:05:39 -0400

hyln9 commented 10 years ago

Reopening as it showed up again.

Launchpad Details: #LPC Abdulaziz Ghuloum - 2008-05-31 13:59:46 -0400