From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: BT Templeton Newsgroups: gmane.lisp.guile.devel Subject: Re: Applicable GOOPS objects? Date: Sat, 24 Mar 2012 00:52:39 -0400 Message-ID: <87obrmlhwo.fsf@olor.terpri.org> References: <87k42bnnt4.fsf@netris.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1332564794 11494 80.91.229.3 (24 Mar 2012 04:53:14 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 24 Mar 2012 04:53:14 +0000 (UTC) To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Sat Mar 24 05:53:14 2012 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SBIyW-0005JA-1I for guile-devel@m.gmane.org; Sat, 24 Mar 2012 05:53:12 +0100 Original-Received: from localhost ([::1]:60676 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SBIyV-0001l3-B4 for guile-devel@m.gmane.org; Sat, 24 Mar 2012 00:53:11 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:42243) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SBIyR-0001kI-Fe for guile-devel@gnu.org; Sat, 24 Mar 2012 00:53:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SBIyP-0003qU-PZ for guile-devel@gnu.org; Sat, 24 Mar 2012 00:53:07 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:54755) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SBIyP-0003qA-Ii for guile-devel@gnu.org; Sat, 24 Mar 2012 00:53:05 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1SBIyL-0005AI-Dv for guile-devel@gnu.org; Sat, 24 Mar 2012 05:53:01 +0100 Original-Received: from cpe-071-070-253-241.nc.res.rr.com ([71.70.253.241]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 24 Mar 2012 05:53:01 +0100 Original-Received: from bpt by cpe-071-070-253-241.nc.res.rr.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 24 Mar 2012 05:53:01 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 32 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: cpe-071-070-253-241.nc.res.rr.com User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.94 (gnu/linux) Cancel-Lock: sha1:MqtJ/kWMciwvD5csM0zb8nXvXUE= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:14176 Archived-At: Mark H Weaver 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. > > I think the most flexible approach is to add a standard generic function > 'generic-apply' that gets called whenever someone tries to use a GOOPS > object as a procedure. I guess 'procedure?' should return true for a > GOOPS object iff there exists an applicable method for 'generic-apply'. > > What do you think? GOOPS defines an metaclass for this (similar to AMOP's funcallable-standard-class): scheme@(guile-user)> (define-class ()) scheme@(guile-user)> ((make #:procedure car) '(1 2)) $1 = 1 Would it work to simply have all Python metaclasses inherit from ? -- Inteligenta persono lernas la lingvon Esperanton rapide kaj facile. Esperanto estas moderna, kultura lingvo por la mondo. Simpla, fleksebla, belsona, Esperanto estas la praktika solvo de la problemo de universala interkompreno. Lernu la interlingvon Esperanton!