Opened 3 years ago

Last modified 3 years ago

#1771 closed defect

Except specificier in imports — at Version 2

Reported by: Idiomdrottning Owned by:
Priority: major Milestone: 5.3
Component: unknown Version:
Keywords: Cc:
Estimated difficulty:

Description (last modified by sjamaan)

Note: this is with the patch for #1757 applied, for the future 5.3.0.

Here is the issue. If this is an egg,

cakes.scm:

(module cakes ()
(import scheme (chicken module) match-generics)
(reexport

(rename scheme (define define-og))
(rename match-generics (define-dx define))))

cakes.egg

((synopsis "A min via for import except")

(components (extension cakes)))

And here is a file that uses that egg:

(import (except cakes define))
(define (lamp x) 19)
(define (lamp x y) 21)
(+ (lamp 13 41)

(lamp 12))

The expected behavior is for this to bork or crash.

Instead it evals to 40, as if we had imported

(import (only cakes define))

Change History (2)

comment:1 Changed 3 years ago by sjamaan

define is a part of the default environment, so it's always there. You can import another definition which will override it, but you can't do it without.

If you put the file using the egg inside a module, it should work as expected.

comment:2 Changed 3 years ago by sjamaan

Description: modified (diff)
Milestone: someday5.3
Note: See TracTickets for help on using tickets.