emacs-devel
[Top][All Lists]
Advanced

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

Re: Instead of pcase


From: Michael Heerdegen
Subject: Re: Instead of pcase
Date: Mon, 20 Nov 2023 16:32:14 +0100
User-agent: Gnus/5.13 (Gnus v5.13)

Barry Fishman <barry@ecubist.org> writes:

> Its also mixing "destructuring" and "guard"s, all in one "super"
> domain specific language.

This is the requirement: in some situations a code path should only be
chosen when a certain structure is present and certain requirements for
certain parts of the structure are fulfilled.  When you separate these
two things artificially you will make the thing more complicated, you
need to introduce extra bindings (for the tests) that the BODY doesn't
use, resulting in poorly readable code.

> I'll take the example pcase code from the Emacs manual:
> [...]
> and be handled better by a generalized value case structure.

These examples have been added to ease learning.  They are not typical
use cases of course.

Michael.




reply via email to

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