From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: phillip.lord@russet.org.uk (Phillip Lord) Newsgroups: gmane.emacs.help Subject: Re: Quick pcase question Date: Wed, 02 Mar 2016 17:18:23 +0000 Message-ID: <878u20vlwg.fsf@russet.org.uk> References: <87lh615gt8.fsf@ericabrahamsen.net> <87mvqhw3a4.fsf@web.de> <87ziuh3z6p.fsf@ericabrahamsen.net> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1456939132 22308 80.91.229.3 (2 Mar 2016 17:18:52 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 2 Mar 2016 17:18:52 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Eric Abrahamsen Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Mar 02 18:18:48 2016 Return-path: Envelope-to: geh-help-gnu-emacs@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 1abAQB-0007K5-7v for geh-help-gnu-emacs@m.gmane.org; Wed, 02 Mar 2016 18:18:47 +0100 Original-Received: from localhost ([::1]:57883 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1abAQ7-0006z8-C2 for geh-help-gnu-emacs@m.gmane.org; Wed, 02 Mar 2016 12:18:43 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38139) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1abAPw-0006z1-6p for help-gnu-emacs@gnu.org; Wed, 02 Mar 2016 12:18:33 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1abAPs-00079L-1k for help-gnu-emacs@gnu.org; Wed, 02 Mar 2016 12:18:32 -0500 Original-Received: from cheviot12.ncl.ac.uk ([128.240.234.12]:51883) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1abAPr-00077o-Rx for help-gnu-emacs@gnu.org; Wed, 02 Mar 2016 12:18:27 -0500 Original-Received: from smtpauth-vm.ncl.ac.uk ([10.8.233.129] helo=smtpauth.ncl.ac.uk) by cheviot12.ncl.ac.uk with esmtp (Exim 4.63) (envelope-from ) id 1abAPn-0007Bj-BD; Wed, 02 Mar 2016 17:18:23 +0000 Original-Received: from jangai.ncl.ac.uk ([10.66.67.223] helo=localhost) by smtpauth.ncl.ac.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.63) (envelope-from ) id 1abAPn-0000U1-5k; Wed, 02 Mar 2016 17:18:23 +0000 In-Reply-To: <87ziuh3z6p.fsf@ericabrahamsen.net> (Eric Abrahamsen's message of "Wed, 2 Mar 2016 19:18:54 +0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 128.240.234.12 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:109402 Archived-At: Eric Abrahamsen writes: > Michael Heerdegen writes: > >> Eric Abrahamsen writes: >> >>> (pcase tst >>> (`(symbolla . ,(and x (pred stringp))) >>> (message "cdr is a string: %s" x))) >>> >>> Is the ",(and x (pred stringp))" part really the simplest way of doing >>> that? >> >> Yes, I think so. >> >> How could it be much simpler (there is not much redundancy in that >> expression)? > > It's not so much the simplicity, I guess, as the intuitiveness -- "(and x" > looks like a test to me, not an assignment. My brain would prefer: > > (,x (pred stringp)) What about? (guard (stringp ,x)) Phil