From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Mark H Weaver Newsgroups: gmane.lisp.guile.devel Subject: Re: Applicable GOOPS objects? Date: Sun, 25 Mar 2012 09:50:41 -0400 Message-ID: <87r4wglrgu.fsf@netris.org> References: <87k42bnnt4.fsf@netris.org> <87obrmlhwo.fsf@olor.terpri.org> <87limpna8g.fsf@netris.org> <87zkb5pnm7.fsf@olor.terpri.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1332683615 28850 80.91.229.3 (25 Mar 2012 13:53:35 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 25 Mar 2012 13:53:35 +0000 (UTC) Cc: guile-devel@gnu.org To: BT Templeton Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Sun Mar 25 15:53:35 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 1SBnt0-0006ph-AC for guile-devel@m.gmane.org; Sun, 25 Mar 2012 15:53:34 +0200 Original-Received: from localhost ([::1]:33919 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SBnsz-0001ui-9u for guile-devel@m.gmane.org; Sun, 25 Mar 2012 09:53:33 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:60006) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SBnsw-0001uS-Mx for guile-devel@gnu.org; Sun, 25 Mar 2012 09:53:31 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SBnsu-0008U4-RL for guile-devel@gnu.org; Sun, 25 Mar 2012 09:53:30 -0400 Original-Received: from world.peace.net ([96.39.62.75]:55282) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SBnsu-0008TD-MQ for guile-devel@gnu.org; Sun, 25 Mar 2012 09:53:28 -0400 Original-Received: from c-98-216-245-176.hsd1.ma.comcast.net ([98.216.245.176] helo=yeeloong) by world.peace.net with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1SBnsa-0007gF-QB; Sun, 25 Mar 2012 09:53:10 -0400 In-Reply-To: <87zkb5pnm7.fsf@olor.terpri.org> (BT Templeton's message of "Sat, 24 Mar 2012 19:48:00 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 96.39.62.75 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:14185 Archived-At: BT Templeton writes: > Mark H Weaver writes: > >> BT Templeton writes: >> >>> Would it work to simply have all Python metaclasses inherit from >>> ? >> >> 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. > > True, but in GOOPS you'd have to change the object's class anyway to add > a slot, I think. So the new dynamically-instantiated class could inherit > from both the original class and . I don't know why it would be necessary to redefine the class in order to add a method, but this is an interesting idea nonetheless. One potential issue is that references to the old class may linger, but that can most likely be addressed by adding a level of indirection to class references in Python. It's not an ideal solution, but it should work. Thanks! Mark