chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] Reimporting modules


From: Peter Bex
Subject: Re: [Chicken-users] Reimporting modules
Date: Thu, 10 Sep 2009 22:24:50 +0200
User-agent: Mutt/1.4.2.3i

On Thu, Sep 10, 2009 at 04:16:22PM -0400, John Cowan wrote:
> We have a problem with modules that get replaced:
> 
> #;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.

It makes more sense to have "import" simply re-import the module if it's
already known.  This allows one to simply re(LOAD) a file with module
imports while at the REPL, just like loading a file containing (DEFINE)s
causes old definitions to be redefined.

Cheers,
Peter
-- 
http://sjamaan.ath.cx
--
"The process of preparing programs for a digital computer
 is especially attractive, not only because it can be economically
 and scientifically rewarding, but also because it can be an aesthetic
 experience much like composing poetry or music."
                                                        -- Donald Knuth

Attachment: pgp7pO41e_RTp.pgp
Description: PGP signature


reply via email to

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