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.user Subject: Re: goops and equal? Date: Tue, 11 Nov 2014 11:17:31 -0500 Message-ID: <87sihpiuec.fsf@yeeloong.lan> References: <87wq73ciwb.fsf@drakenvlieg.flower> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1415722770 13958 80.91.229.3 (11 Nov 2014 16:19:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 11 Nov 2014 16:19:30 +0000 (UTC) Cc: guile-user@gnu.org To: Jan Nieuwenhuizen Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Tue Nov 11 17:19:23 2014 Return-path: Envelope-to: guile-user@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 1XoEA7-00005S-IC for guile-user@m.gmane.org; Tue, 11 Nov 2014 17:19:23 +0100 Original-Received: from localhost ([::1]:49509 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XoEA7-0007uN-2B for guile-user@m.gmane.org; Tue, 11 Nov 2014 11:19:23 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53799) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XoE9q-0007nL-A6 for guile-user@gnu.org; Tue, 11 Nov 2014 11:19:12 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XoE9k-0006MU-EB for guile-user@gnu.org; Tue, 11 Nov 2014 11:19:06 -0500 Original-Received: from world.peace.net ([96.39.62.75]:43024) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XoE9k-0006La-AP; Tue, 11 Nov 2014 11:19:00 -0500 Original-Received: from c-24-62-95-23.hsd1.ma.comcast.net ([24.62.95.23] helo=yeeloong.lan) by world.peace.net with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1XoE9T-0001ZL-DS; Tue, 11 Nov 2014 11:18:43 -0500 In-Reply-To: <87wq73ciwb.fsf@drakenvlieg.flower> (Jan Nieuwenhuizen's message of "Mon, 10 Nov 2014 13:57:56 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 96.39.62.75 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:11632 Archived-At: Jan Nieuwenhuizen writes: > In the example below, my implementation of equal? is only being > used if both types are the same. That surprised me; the manual > says equal? becomes a generic and for normal generics this works > as I expect. 'equal?' is actually a "primitive generic", which means that it's a core C function that handles the cases it knows about, and only calls out to user-defined GOOPS methods for cases that aren't handled internally. One of the facts known by core 'equal?' is that objects of different types are not equal. It may be that we should relax this somewhat, but IMO it's probably a bad idea to allow instances of your user-defined type to be 'equal?' to symbols. Out of curiosity, why do you want this? BTW, in order to allow user-defined types to be 'equal?' to built-in types, we'd also need to change our hashing function for 'equal?'-based hash tables. Regards, Mark