chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-users] Reimporting modules


From: John Cowan
Subject: [Chicken-users] Reimporting modules
Date: Thu, 10 Sep 2009 16:16:22 -0400
User-agent: Mutt/1.5.13 (2006-08-11)

We have a problem with modules that get replaced:

$ csi

CHICKEN
(c)2008-2009 The Chicken Team
(c)2000-2007 Felix L. Winkelmann
Version 4.1.9 - SVN rev. 15267
linux-unix-gnu-x86 [ manyargs dload ptables applyhook ]
compiled 2009-07-26 on jcowan-laptop (Linux)

#;1> (module foo (foo) (import scheme) (define foo 32))
; loading /usr/local/lib/chicken/4/scheme.import.so ...
#;2> (import foo)
#;3> foo
32                      ; This is good.
#;4> (module foo (foo) (import scheme) (define foo 64))
#;5> (import foo)
#;6> foo
32                      ; This is bad.
#;7> (module bar () (import scheme) (import foo) foo)
32                      ; This is very, very bad.
#;8>

To solve the problem at 6, I think we need a "reimport" syntactic form,
which will import modules that have already been imported.  The problem
at 7 looks like a plain bug to me; the fact that the old foo was imported
into the top level certainly should not affect a fresh import into the
bar module.

Alternatively, if redefining modules is simply not supported at all,
then 4 should provoke an error.

-- 
Possession is said to be nine points of the law,                John Cowan
but that's not saying how many points the law might have.       address@hidden
        --Thomas A. Cowan (law professor and my father)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]