internal (import) allows redefinitions at the repl

Bug #270187 reported by Abdulaziz Ghuloum
4
Affects Status Importance Assigned to Milestone
Ikarus Scheme
Fix Committed
Medium
Abdulaziz Ghuloum

Bug Description

test.ss:

(import (ikarus))
(library (X) (export a) (import (ikarus)) (define a 'X))
(library (Y) (export a) (import (ikarus)) (define a 'Y))
(pretty-print
  (let ()
    (import (X))
    (import (Y))
    a))

$ ikarus test.ss
Ikarus Scheme version 0.0.3+ (revision 1599, build 2008-09-13, 64-bit)
Copyright (c) 2006-2008 Abdulaziz Ghuloum

Y
$ ikarus --r6rs-script test.ss
Unhandled exception:
 Condition components:
   1. &who: a
   2. &message: "cannot redefine"
   3. &syntax:
       form: a
       subform: #f
   4. &trace: #<syntax a>

Related branches

Changed in ikarus:
assignee: nobody → aghuloum
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
leppie (leppie) wrote :

Hi

A question:

Given the about X and Y libraries, would it be correct to import them into separate lexical scopes? Eg:

(let ()
    (import (X))
    a)

(let ()
    (import (Y))
    a)

Cheers

leppie

Revision history for this message
leppie (leppie) wrote :

s/about/above

Oops :o)

Revision history for this message
Abdulaziz Ghuloum (aghuloum) wrote : Re: [Bug 270187] Re: internal (import) allows redefinitions at the repl

On Sep 15, 2008, at 11:50 AM, leppie wrote:

> A question:
>
> Given the about X and Y libraries, would it be correct to import them
> into separate lexical scopes? Eg:
>
> (let ()
> (import (X))
> a)
>
> (let ()
> (import (Y))
> a)

Of course.

Revision history for this message
Derick Eddington (derick-eddington) wrote :

I think this is related:

$ cat internal-define-duplicates.sps
(import (ikarus))
(let ()
  (define x 1)
  (define x 2)
  (pretty-print x))
$ ikarus internal-define-duplicates.sps
Ikarus Scheme version 0.0.3+ (revision 1649, build 2008-10-28)
Copyright (c) 2006-2008 Abdulaziz Ghuloum

2
>
$ ikarus --r6rs-script internal-define-duplicates.sps
Unhandled exception:
 Condition components:
   1. &who: x
   2. &message: "multiple definitions of identifier"
   3. &syntax:
       form: x
       subform: #f
   4. &source-information:
       file-name: "internal-define-duplicates.sps"
       character: 52
   5. &trace: #<syntax x (char 52 of internal-define-duplicates.sps)>
$

Revision history for this message
Abdulaziz Ghuloum (aghuloum) wrote :

It is related. Will investigate more.

Revision history for this message
Abdulaziz Ghuloum (aghuloum) wrote :

Fixed in revision 1655 and added some tests for the semantics of the repl.
The tests did help avoid some problems that we would've run to due to the change, but they're not that comprehensive.
If something breaks in the repl, somebody remind me to add appropriate tests.

Thank!

Aziz,,,

Changed in ikarus:
status: Confirmed → Fix Committed
Changed in ikarus:
milestone: none → 0.0.4
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.