guile-user
[Top][All Lists]
Advanced

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

defined? in module


From: Daniel Kraft
Subject: defined? in module
Date: Sun, 05 Jul 2009 15:18:36 +0200
User-agent: Thunderbird 2.0.0.0 (X11/20070425)

Hi,

I'm trying to check if a given name is bound within some module. It seems (from the documentation) that module objects are considered environments; but this does not work:

scheme@(guile-user)> (defined? 'abc (current-module))

Backtrace:
In unknown file:
   ?: 0* [#<vm b7a8e650> #<program b70ac450 at <unknown port>:1:0 ()>]
   2: 1* [#<program b70ac450 at <unknown port>:1:0 ()>]
   ?: 2* [defined? abc {#<directory (guile-user) 80bb3f0>}]

ERROR: In procedure defined?:
ERROR: Wrong type argument in position 2: #<directory (guile-user) 80bb3f0>

So, what's wrong here and how to do this correctly? (I know that testing for 'abc in current-module is trivial, but say I want to find out about 'abc in (language elisp runtime value-slot) for instance.)

BTW, finally, I want to do this in Tree-IL. But if I manage to do it in Scheme, changing to Tree-IL is trivial.

Thanks a lot,
Daniel





reply via email to

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