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

REPL: faulty redefinition undefines the existing variable #262

Open hyln9 opened 10 years ago

hyln9 commented 10 years ago

Trying to redefine an existing variable, but making an error on the right hand side causes the variable to become unbound:

juergen@Nix:~$ ikarus Ikarus Scheme version 0.0.4-rc1+, 64-bit (revision 1856, build 2009-09-13) Copyright (c) 2006-2009 Abdulaziz Ghuloum

(define + foobar) Unhandled exception Condition components:

  1. &undefined
  2. &who: eval
  3. &message: "unbound variable"
  4. &irritants: (foobar) + Unhandled exception Condition components:
    1. &undefined
  5. &who: eval
  6. &message: "unbound variable"
  7. &irritants: (+)

Similarily the following definition also unbinds the variable:

juergen@Nix:~$ ikarus Ikarus Scheme version 0.0.4-rc1+, 64-bit (revision 1856, build 2009-09-13) Copyright (c) 2006-2009 Abdulaziz Ghuloum

(define + (let ((plus +)) plus)) Unhandled exception Condition components:

  1. &undefined
  2. &who: eval
  3. &message: "unbound variable"
  4. &irritants: (+) + Unhandled exception Condition components:
    1. &undefined
  5. &who: eval
  6. &message: "unbound variable"
  7. &irritants: (+)

Juergen

Launchpad Details: #LP428695 Juergen Haase - 2009-09-12 21:59:30 -0400

hyln9 commented 10 years ago

I'm aware of this problem and I know that other systems (Chez Scheme, Larceny) exhibit the same behavior. I don't know (yet) if this is really a bug in these implementations that should be fixed or if it's something that's inherent in the library/repl interaction and thus cannot be fixed.

I know and can explain the cause of the problem, but that's not enough to make it "not a bug".

I'll let you know what I know, and thanks for the report.

Aziz,,,

Launchpad Details: #LPC Abdulaziz Ghuloum - 2009-09-12 23:10:19 -0400

hyln9 commented 10 years ago

On Sep 13, 2009, at 6:10 AM, Abdulaziz Ghuloum wrote:

I'll let you know what I know,

In the mean time, if you want to get your + procedure back, just type (import (only (rnrs) +)). :-)

Aziz,,,

Launchpad Details: #LPC Abdulaziz Ghuloum - 2009-09-12 23:12:23 -0400