emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Question on pcase


From: Alan Mackenzie
Subject: Re: Question on pcase
Date: Sat, 24 Oct 2015 17:22:58 +0000
User-agent: Mutt/1.5.23 (2014-03-12)

Hello, Drew

On Sat, Oct 24, 2015 at 10:00:05AM -0700, Drew Adams wrote:
> Good comments about the language, Alan.

Thanks!

> One suggestion:

> > 5. "the `pred' pattern form allows to simplify ...." is a very common
> > solecism.  The verb "allow" needs a direct object, not an infinitive verb.
> > That object can either be the person (or thing) who is being allowed to do
> > something, or the thing (a noun or gerund) which is being allowed.  So
> > here, you'd want one of
> >   o - "the `pred' pattern form allows YOU to simplify ...." or
> >   o - "the `pred' pattern form allows THE SIMPLIFICATION OF ...." or even
> >   o - "the `pred' pattern form allows SIMPLIFYING ...."

> It's usually simpler and clearer to use "let" than "allows
> ... to".

Linguistically, "let" is as complicated as "allow".  It's also a bit
more restrictive: you need as the direct object the person (or thing)
which is being "let" do something.  This is followed by the infinitive
without the "to":

  o - "the `pred' pattern form lets you simplify ...."

> But it is usually better still to put the user first, as the active
> subject of the action:

Yes, perhaps, sometimes, maybe, ....

>   You can use `pred' to ...

> or if it's not clear what `pred' is:

>   You can use pattern `pred' to ...

> or:

>   You can simplify ... using `pred'.

> The user is the actor; pattern `pred' is the tool.

> (I did not look at the original, but a guess might be that
> someone reading Info should see PRED here (no quotes), not
> `pred'.

You're wrong here.  :-)  `pred' is an actual keyword in the pcase
mechanism.  (What exactly is the English for the German "Konzept"?
That's what I really wanted at the end of that sentence.)

> Another guess, again without consulting the text, is that perhaps you
> don't need both "pattern" and "form": "pattern form".)

I think they're both meaningful - the "pattern" is a description of what
is being matched, and the "form" is the lisp form which achieves this
matching.  I think.

> And I too thank Michael for helping us (all) understand the
> obtuse creature that is `pcase'.  It is comforting (and all
> too rare, it seems) to see such careful interest in helping
> Emacs document itself.  Kudos - very helpful.

Very helpful indeed!

-- 
Alan Mackenzie (Nuremberg, Germany).



reply via email to

[Prev in Thread] Current Thread [Next in Thread]