guile-user
[Top][All Lists]
Advanced

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

Re: guile 1.7 eval 'problem'


From: Neil Jerram
Subject: Re: guile 1.7 eval 'problem'
Date: 30 Aug 2001 21:52:09 +0100
User-agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7

>>>>> "David" == David Pirotte <address@hidden> writes:

    David> Hi, the following code that was working in guile 1.4.1 does
    David> not anymore in guile 1.7:

    David> what's wrong ? Is it (interaction-environment) ?

Yes.  (interaction-environment) is the same as (current-module), so it
changes according to module in which your method is called, and that
module might be one which doesn't have (oop goops) in its uses list.
(See below for relevant experimentation.)

Perhaps what you want is to add

(define this-module (current-module))

and then use `this-module' as the second eval argument rather than
`(interaction-environment)'.

I'm not sure why it worked in guile 1.4.1, but I think that our
understanding of eval and modules is better now than before, so the
old behaviour was probably just wrong.

        Neil


guile> address@hidden ~]$ guile
reading .guile
guile> (eval 'make (interaction-environment))
<unnamed port>: In expression make:
<unnamed port>: Unbound variable: make
ABORT: (unbound-variable)

Type "(backtrace)" to get more information or "(debug)" to enter the debugger.
guile> (define-module (new two))             
($ 1) => #<directory (new two) 808a550>
guile> (current-module)
($ 2) => #<directory (new two) 808a550>
guile> (use-modules (oop goops))             
guile> (eval 'make (interaction-environment))
($ 3) => #<<generic> make-instance (1)>
guile> (define-module (guile-user))
($ 4) => #<directory (guile-user) 80844d0>
guile> (eval 'make (interaction-environment))
<unnamed port>: In expression make:
<unnamed port>: Unbound variable: make
ABORT: (unbound-variable)
guile> (define-module (new two))             
($ 5) => #<directory (new two) 808a550>
guile> (interaction-environment)             
($ 6) => #<directory (new two) 808a550>
guile> 




reply via email to

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