guile-user
[Top][All Lists]
Advanced

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

Re: namespace of goops module


From: Neil Jerram
Subject: Re: namespace of goops module
Date: Tue, 14 Feb 2006 22:43:03 +0000
User-agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux)

William Xu <address@hidden> writes:

> guile> (use-modules ((oop goops) :renamer (symbol-prefix-proc 'oop/goops:)))
>
> This seems okay. While, when i try the first example in GOOPS Info, 
>
> guile> (oop/goops:define-method (+ (x <string>) (y <string>))
>        (string-append x y))
> <unnamed port>: In expression (add-method! + (method # #)):
> <unnamed port>: Unbound variable: add-method!
> ABORT: (unbound-variable)
>
> Type "(backtrace)" to get more information or "(debug)" to enter the debugger.
> guile> 
>
> Seems i can't add a renamer for goops module, but make it available on
> top-level? While, GOOPS is not built in guile, is it?
>
> So what's the point here?

Hmm, it looks like the point is that renaming won't work when a module
defines a macro (with either defmacro or define-macro) whose expansion
includes one of that module's own bindings.

Interesting problem.  I think it should work for the macro definition
to unquote such bindings, so that they are looked up in the module's
environment at definition time rather than later in the caller's
environment.  In other words,

(define-macro (whatever ...)
  `(,what* ...))

rather than

(define-macro (whatever ...)
  `(what* ...))

To make progress in the short term, though, I think you'll have to use
(oop goops) without a renamer.

    Neil 





reply via email to

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