guile-devel
[Top][All Lists]
Advanced

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

Re: program-module returns a non-module


From: Ludovic Courtès
Subject: Re: program-module returns a non-module
Date: Sun, 05 Sep 2010 12:28:18 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux)

Hello,

"Jose A. Ortega Ruiz" <address@hidden> writes:

> When called on a program (procedure object) implemented in C,
> program-module returns something that is not a module:
>
>   (define cp (module-ref (current-module) 'cons))
>
>   (program? cp) => #t
>   (program-module cp) => #<pointer 0xb77ccbb0>
>   (module? (program-module cp)) => #f

Apparently ‘program-module’ assumes that the first object in a program
object table is the module in question, but that is no longer true:

  scheme@(guile-user)> (program-objects (lambda x x))
  $56 = #f
  scheme@(guile-user)> (program-objects cons)
  $57 = #(#<pointer 0x7f2992042d60> cons)

except for programs referring to global bindings:

  scheme@(guile-user)> (program-objects (lambda x getaddrinfo))
  $60 = #(#<directory (guile-user) 109c090> getaddrinfo)

Hmm ‘compile-assembly.scm’ has this ‘*module*’ variable, which seems to
relate to this.  Needs more investigation...

Ludo’.




reply via email to

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