all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#68030: 29.1; (elisp) `pcase Macro' Reformulation with `pcase' example
@ 2023-12-25 16:41 Drew Adams
  2023-12-25 16:47 ` Stefan Kangas
  0 siblings, 1 reply; 3+ messages in thread
From: Drew Adams @ 2023-12-25 16:41 UTC (permalink / raw)
  To: 68030

We shouldn't try to introduce (and perhaps even motivate) the use of
`pcase' for such a "simple matching task".  The `pcase' version is
many times more complex than the simple `if' version with a
single-sexp THEN and a single-sexp ELSE.

Even if the aim is to present `or', `and', `pred' and `app', a better
example should be used - something where it really _helps_ to use those
subpatterns.  In the example chosen they just add noise.

[Not part of this bug report, but you might also want to move the whole
`Caveats for SYMBOL in Sequencing Patterns' to a separate node (with
`pcase' somewhere in the node name).]

In GNU Emacs 29.1 (build 2, x86_64-w64-mingw32) of 2023-08-02 built on
 AVALON
Windowing system distributor 'Microsoft Corp.', version 10.0.19045
System Description: Microsoft Windows 10 Pro (v10.0.2009.19045.3803)

Configured using:
 'configure --with-modules --without-dbus --with-native-compilation=aot
 --without-compress-install --with-tree-sitter CFLAGS=-O2'

Configured features:
ACL GIF GMP GNUTLS HARFBUZZ JPEG JSON LCMS2 LIBXML2 MODULES NATIVE_COMP
NOTIFY W32NOTIFY PDUMPER PNG RSVG SOUND SQLITE3 THREADS TIFF
TOOLKIT_SCROLL_BARS TREE_SITTER WEBP XPM ZLIB

(NATIVE_COMP present but libgccjit not available)






^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#68030: 29.1; (elisp) `pcase Macro' Reformulation with `pcase' example
  2023-12-25 16:41 bug#68030: 29.1; (elisp) `pcase Macro' Reformulation with `pcase' example Drew Adams
@ 2023-12-25 16:47 ` Stefan Kangas
  2023-12-26 17:48   ` Drew Adams
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan Kangas @ 2023-12-25 16:47 UTC (permalink / raw)
  To: Drew Adams, 68030-done

Drew Adams <drew.adams@oracle.com> writes:

> We shouldn't try to introduce (and perhaps even motivate) the use of
> `pcase' for such a "simple matching task".  The `pcase' version is
> many times more complex than the simple `if' version with a
> single-sexp THEN and a single-sexp ELSE.

The purpose is to start with a small example to teach the reader about
pcase.  I see nothing that needs changing here.

> Even if the aim is to present `or', `and', `pred' and `app', a better
> example should be used - something where it really _helps_ to use those
> subpatterns.  In the example chosen they just add noise.

Without any concrete suggestions, I don't see anything actionable here.
I'm therefore closing this bug report.

> [Not part of this bug report, but you might also want to move the whole
> `Caveats for SYMBOL in Sequencing Patterns' to a separate node (with
> `pcase' somewhere in the node name).]

I don't see any benefit in doing that.

>
> In GNU Emacs 29.1 (build 2, x86_64-w64-mingw32) of 2023-08-02 built on
>  AVALON
> Windowing system distributor 'Microsoft Corp.', version 10.0.19045
> System Description: Microsoft Windows 10 Pro (v10.0.2009.19045.3803)
>
> Configured using:
>  'configure --with-modules --without-dbus --with-native-compilation=aot
>  --without-compress-install --with-tree-sitter CFLAGS=-O2'
>
> Configured features:
> ACL GIF GMP GNUTLS HARFBUZZ JPEG JSON LCMS2 LIBXML2 MODULES NATIVE_COMP
> NOTIFY W32NOTIFY PDUMPER PNG RSVG SOUND SQLITE3 THREADS TIFF
> TOOLKIT_SCROLL_BARS TREE_SITTER WEBP XPM ZLIB
>
> (NATIVE_COMP present but libgccjit not available)





^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#68030: 29.1; (elisp) `pcase Macro' Reformulation with `pcase' example
  2023-12-25 16:47 ` Stefan Kangas
@ 2023-12-26 17:48   ` Drew Adams
  0 siblings, 0 replies; 3+ messages in thread
From: Drew Adams @ 2023-12-26 17:48 UTC (permalink / raw)
  To: Stefan Kangas, 68030-done@debbugs.gnu.org

> > We shouldn't try to introduce (and perhaps
> > even motivate) the use of `pcase' for such
> > a "simple matching task".  The `pcase'
> > version is many times more complex than the
> > simple `if' version with a single-sexp THEN
> > and a single-sexp ELSE.
> 
> The purpose is to start with a small example to teach the
> reader about pcase.  I see nothing that needs changing here.

It doesn't teach the reader about `pcase'.
It shows nothing about what `pcase' really
offers.

`pcase' is not at all about doing, in a
more complicated way, what you can do
simpler with `if'.  It's about doing other
things more simply than you can with `if'.

> > Even if the aim is to present `or', `and',
> > `pred' and `app', a better example should
> > be used - something where it really _helps_
> > to use those subpatterns.  In the example
> > chosen they just add noise.
> 
> Without any concrete suggestions, I don't see
> anything actionable here.

Put on your Thinking Cap.  You shouldn't
need any "concrete suggestions".  I'm sure
you can come up with a solution if you can
understand the problem.

> I'm therefore closing this bug report.
> 
> > [Not part of this bug report, but you might
> >  also want to move the whole `Caveats for
> >  SYMBOL in Sequencing Patterns' to a separate
> >  node (with `pcase' somewhere in the node name).]
> 
> I don't see any benefit in doing that.

It's a giant footnote - meta-information.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-12-26 17:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-25 16:41 bug#68030: 29.1; (elisp) `pcase Macro' Reformulation with `pcase' example Drew Adams
2023-12-25 16:47 ` Stefan Kangas
2023-12-26 17:48   ` Drew Adams

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.