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: type checking for arbitrary lisp objects Date: Fri, 11 Apr 2014 16:03:05 -0400 Message-ID: References: <15888.20727.131941.21320@gargle.gargle.HOWL> <53483E8E.50406@dancol.org> <16657.80762.790748.21320@gargle.gargle.HOWL> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1397246638 30423 80.91.229.3 (11 Apr 2014 20:03:58 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 11 Apr 2014 20:03:58 +0000 (UTC) Cc: Daniel Colascione , emacs-devel@gnu.org To: "Roland Winkler" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Apr 11 22:03:51 2014 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 1WYhfy-0006Zc-Sq for ged-emacs-devel@m.gmane.org; Fri, 11 Apr 2014 22:03:50 +0200 Original-Received: from localhost ([::1]:59635 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WYhfy-0005UE-Fy for ged-emacs-devel@m.gmane.org; Fri, 11 Apr 2014 16:03:50 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38515) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WYhfo-0005U5-G6 for emacs-devel@gnu.org; Fri, 11 Apr 2014 16:03:48 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WYhfg-0002Zg-9r for emacs-devel@gnu.org; Fri, 11 Apr 2014 16:03:40 -0400 Original-Received: from mercure.iro.umontreal.ca ([132.204.24.67]:34272) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WYhfg-0002Zb-59; Fri, 11 Apr 2014 16:03:32 -0400 Original-Received: from hidalgo.iro.umontreal.ca (hidalgo.iro.umontreal.ca [132.204.27.50]) by mercure.iro.umontreal.ca (Postfix) with ESMTP id D768184D8C; Fri, 11 Apr 2014 16:03:31 -0400 (EDT) Original-Received: from lechon.iro.umontreal.ca (lechon.iro.umontreal.ca [132.204.27.242]) by hidalgo.iro.umontreal.ca (Postfix) with ESMTP id 2C8381E5B7C; Fri, 11 Apr 2014 16:03:06 -0400 (EDT) Original-Received: by lechon.iro.umontreal.ca (Postfix, from userid 20848) id 072B9B4180; Fri, 11 Apr 2014 16:03:05 -0400 (EDT) In-Reply-To: <16657.80762.790748.21320@gargle.gargle.HOWL> (Roland Winkler's message of "Fri, 11 Apr 2014 14:22:57 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-DIRO-MailScanner-Information: Please contact the ISP for more information X-DIRO-MailScanner: Found to be clean X-DIRO-MailScanner-SpamCheck: n'est pas un polluriel, SpamAssassin (score=-2.82, requis 5, autolearn=not spam, ALL_TRUSTED -2.82, MC_TSTLAST 0.00) X-DIRO-MailScanner-From: monnier@iro.umontreal.ca X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 132.204.24.67 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:171407 Archived-At: >> Why not use cl-deftype? > ...Interesting! - I guess the main difference to what I have in mind > is that cl-deftype appears to require some lisp code for FORMS. > I am thinking about replacing these forms by some more readable > pattern such as the one I included in my first post. The function > bbdb-check-type then compares an arbitrary lisp object against such > pattern. I find it more readable and also more flexible to define > patterns instead of hacking actual code. AFAIK cl-deftype is specifically there to define those patterns, so you can later pass them to cl-check-type. Stefan