all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eric Abrahamsen <eric@ericabrahamsen.net>
To: help-gnu-emacs@gnu.org
Subject: Re: Quick pcase question
Date: Thu, 03 Mar 2016 09:08:25 +0800	[thread overview]
Message-ID: <87mvqg4bcm.fsf@ericabrahamsen.net> (raw)
In-Reply-To: 878u20vlwg.fsf@russet.org.uk

phillip.lord@russet.org.uk (Phillip Lord) writes:

> Eric Abrahamsen <eric@ericabrahamsen.net> writes:
>
>> Michael Heerdegen <michael_heerdegen@web.de> writes:
>>
>>> Eric Abrahamsen <eric@ericabrahamsen.net> 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))

You're suggesting that as a possible alternate syntax, right? (In which
case I like it.) It doesn't actually work now, does it?




  reply	other threads:[~2016-03-03  1:08 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-02 10:12 Quick pcase question Eric Abrahamsen
2016-03-02 11:02 ` Michael Heerdegen
2016-03-02 11:18   ` Eric Abrahamsen
2016-03-02 11:38     ` Michael Heerdegen
2016-03-02 11:56       ` Eric Abrahamsen
2016-03-02 12:27         ` Michael Heerdegen
2016-03-02 17:25           ` Phillip Lord
2016-03-03  1:13             ` Eric Abrahamsen
2016-03-03  3:47             ` Stefan Monnier
2016-03-02 17:18     ` Phillip Lord
2016-03-03  1:08       ` Eric Abrahamsen [this message]
2016-03-03 12:08         ` Phillip Lord
2016-03-02 12:40 ` Phillip Lord

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87mvqg4bcm.fsf@ericabrahamsen.net \
    --to=eric@ericabrahamsen.net \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.