unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Mark H Weaver <mhw@netris.org>
To: BT Templeton <bpt@hcoop.net>
Cc: guile-devel@gnu.org
Subject: Re: Applicable GOOPS objects?
Date: Sat, 24 Mar 2012 14:07:43 -0400	[thread overview]
Message-ID: <87limpna8g.fsf@netris.org> (raw)
In-Reply-To: <87obrmlhwo.fsf@olor.terpri.org> (BT Templeton's message of "Sat,  24 Mar 2012 00:52:39 -0400")

BT Templeton <bpt@hcoop.net> writes:

> 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>?

On second thought, I see a problem with this idea: it would mean that
'procedure?' would return true for _any_ Python object.

In order to avoid this problem, the Python implementation would need to
know at class-creation time whether the __call__ method will be
supported.  My knowledge of Python is very rusty, but I'm pretty sure
that the user could add a __call__ method at any time.

      Mark



  parent reply	other threads:[~2012-03-24 18:07 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-23 19:02 Applicable GOOPS objects? Mark H Weaver
2012-03-24  3:36 ` Nala Ginrut
2012-03-24  4:52 ` BT Templeton
2012-03-24  6:23   ` Mark H Weaver
2012-03-24 18:07   ` Mark H Weaver [this message]
2012-03-24 23:48     ` BT Templeton
2012-03-25 13:50       ` Mark H Weaver

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87limpna8g.fsf@netris.org \
    --to=mhw@netris.org \
    --cc=bpt@hcoop.net \
    --cc=guile-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).