[plt-scheme] Re: Serializable class.ss generics
On 5/9/06, Evangelos Tsagkas <lunluc at gmail.com> wrote:
>
> ... However, since I cannot create
> serializable interfaces (or can I?) one of the arguments will be the
> *name* of the interface to pass to the generic's constructor...
I take it my assumption is valid.
> ... How can
> I then retrieve the run-time binding of that interface name from the
> namespace?
>
> [for the blah-blah-challenged...]
>
> (define-serializable-struct gen (%-or-<%> method))
> (define m (make-gen 'person<%> 'say-hello))
> (define mm (deserialize (serialize m)))
>
> (make-generic
> (?exp? (namespace-symbol->identifier
> (gen-%-or-<%> mm)))
> (gen-method mm))
>
> I guess I need something in ?exp? but can't figure out what. Unless
> I'm totally off my head here :-)
>
> Evangelos
(namespace-variable-value ...) is the ?exp? I was after.
Thanks to Paulo Matos's recent "namespace-variable-value missing?"
question on the list.
I thought I'd better answer my question on the list, for the sake of
completeness.
Evangelos