opensubscriber
   Find in this group all groups
 
Unknown more information…

g : guile-devel@gnu.org 24 March 2012 • 2:23PM -0400

Re: Applicable GOOPS objects?
by Mark H Weaver

REPLY TO AUTHOR
 
REPLY TO GROUP




BT Templeton <bpt@hcoo...> writes:

> Mark H Weaver <mhw@netr...> writes:
>
>> Hello all,
>>
>> I was chatting with the folks working on Python-on-Guile, and it seems
>> clear that they need the ability to create GOOPS objects that can
>> emulate procedures.  Otherwise they will probably end up creating an
>> entirely separate object system for Python, which would obviously be
>> suboptimal.
[...]
>
> GOOPS defines an <applicable-struct-class> metaclass for this (similar
> to AMOP's funcallable-standard-class):
>
> scheme@(guile-user)> (define-class <foo> (<applicable-struct>))
> scheme@(guile-user)> ((make <foo> #:procedure car) '(1 2))
> $1 = 1
>
> Would it work to simply have all Python metaclasses inherit from
> <applicable-struct-class>?

Yes, I believe it will.  Thanks very much! :)

    Mark


PS: I notice that there's also 'scm_class_applicable_struct_with_setter'
    which is exported as SCM_API, but was apparently never implemented
    and is always NULL.


Bookmark with:

Delicious   Digg   reddit   Facebook   StumbleUpon

Related Messages

opensubscriber is not affiliated with the authors of this message nor responsible for its content.