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: Thu, 10 Oct 2013 16:43:55 -0400 Message-ID: References: <85k3hlcqvm.fsf@junk.nocrew.org> <8561t5cclt.fsf@junk.nocrew.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1381437852 28658 80.91.229.3 (10 Oct 2013 20:44:12 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 10 Oct 2013 20:44:12 +0000 (UTC) Cc: emacs-devel@gnu.org To: Lars Brinkhoff Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Oct 10 22:44:15 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 1VUN5j-00010o-5i for ged-emacs-devel@m.gmane.org; Thu, 10 Oct 2013 22:44:15 +0200 Original-Received: from localhost ([::1]:51038 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VUN5i-0001rX-Pa for ged-emacs-devel@m.gmane.org; Thu, 10 Oct 2013 16:44:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58922) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VUN5Y-0001rD-7A for emacs-devel@gnu.org; Thu, 10 Oct 2013 16:44:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VUN5Q-0004lS-K8 for emacs-devel@gnu.org; Thu, 10 Oct 2013 16:44:04 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.182]:51964) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VUN5Q-0004lN-FU for emacs-devel@gnu.org; Thu, 10 Oct 2013 16:43:56 -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="35231881" 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; 10 Oct 2013 16:40:07 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id A6C8360C28; Thu, 10 Oct 2013 16:43:55 -0400 (EDT) In-Reply-To: <8561t5cclt.fsf@junk.nocrew.org> (Lars Brinkhoff's message of "Thu, 10 Oct 2013 18:30:38 +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:164069 Archived-At: > (defun frob (x) > (cond > ((vectorp x) (frob-vector x)) > ((foop x) (frob-foo x)))) > In the case of an FFI, a wrapper may want to be able to pass a vector > or a "struct" (something like a pseudovector) to Emacs, and have Lisp > code be able to tell the difference. In Elisp, such type-overlaps are common. E.g. you should first check `functionp' before `consp' if you can accept both lists and functions. So similarly the above code should check `foop' before `vectorp'. Stefan