From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: RFC: User-defined pseudovectors Date: Fri, 11 Oct 2013 08:22:57 -0400 Message-ID: References: <85k3hlcqvm.fsf@junk.nocrew.org> <8561t5cclt.fsf@junk.nocrew.org> <85mwmgbb4l.fsf@junk.nocrew.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1381494198 29847 80.91.229.3 (11 Oct 2013 12:23:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 11 Oct 2013 12:23:18 +0000 (UTC) Cc: emacs-devel@gnu.org To: Lars Brinkhoff Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Oct 11 14:23:21 2013 Return-path: Envelope-to: ged-emacs-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 1VUbkW-0006QW-UQ for ged-emacs-devel@m.gmane.org; Fri, 11 Oct 2013 14:23:21 +0200 Original-Received: from localhost ([::1]:54058 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VUbkT-0004zR-9Z for ged-emacs-devel@m.gmane.org; Fri, 11 Oct 2013 08:23:17 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57453) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VUbkI-0004zB-1h for emacs-devel@gnu.org; Fri, 11 Oct 2013 08:23:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VUbkA-00039F-Nv for emacs-devel@gnu.org; Fri, 11 Oct 2013 08:23:05 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.182]:27676) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VUbkA-000397-JS for emacs-devel@gnu.org; Fri, 11 Oct 2013 08:22:58 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av4EABK/CFFMCreE/2dsb2JhbABEvw4Xc4IeAQEEAVYjBQsLNBIUGA0kiB4GwS2RCgOkeoFegxM X-IPAS-Result: Av4EABK/CFFMCreE/2dsb2JhbABEvw4Xc4IeAQEEAVYjBQsLNBIUGA0kiB4GwS2RCgOkeoFegxM X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; d="scan'208";a="35269191" Original-Received: from 76-10-183-132.dsl.teksavvy.com (HELO pastel.home) ([76.10.183.132]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 11 Oct 2013 08:19:06 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 50E0860ED2; Fri, 11 Oct 2013 08:22:57 -0400 (EDT) In-Reply-To: <85mwmgbb4l.fsf@junk.nocrew.org> (Lars Brinkhoff's message of "Fri, 11 Oct 2013 08:00:10 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 206.248.154.182 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:164092 Archived-At: > that the need increases. Most other languages have some kind of > user-defined record types, and they are used quite liberally. I'm not necessarily opposed to user-defined record types, but if cl-defstruct is not sufficient and C-level changes are required, then I'd hope for the new code to provide more exciting features than just "vectorp returns nil". >>> (cond >>> ((vectorp x) (frob-vector x)) >>> ((foop x) (frob-foo x)))) >> So similarly the above code should check `foop' before `vectorp'. > That would still fail for the input [foo]. Not sure if it should be considered as a bug, tho (it depends on what was the intention of the caller. IOW: would she have passed #%[foo] or [foo] in your version of Emacs?). Especially for cl-defstruct objects where you'd need to pass [cl-defstruct-foo]. But if that's a problem, you can use a more unique object as tag, e.g. an uninterned symbol. Stefan