unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* defined? in module
@ 2009-07-05 13:18 Daniel Kraft
  2009-07-17 14:54 ` Ludovic Courtès
  0 siblings, 1 reply; 3+ messages in thread
From: Daniel Kraft @ 2009-07-05 13:18 UTC (permalink / raw)
  To: guile-user

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





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-07-24 12:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-05 13:18 defined? in module Daniel Kraft
2009-07-17 14:54 ` Ludovic Courtès
2009-07-24 12:05   ` Andy Wingo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).