From: Maxime Devos <maximedevos@telenet.be>
To: Blake Shaw <blake@sweatshoppe.org>, guile-devel <guile-devel@gnu.org>
Subject: Re: [PATCH v1 1/6] docs/match: add pattern matching examples
Date: Sun, 29 Jan 2023 16:30:08 +0100 [thread overview]
Message-ID: <9a5ee863-c768-4109-3323-908adc277479@telenet.be> (raw)
In-Reply-To: <CAKjmbcAucYA9j7suY1gEAO512pn+90ED33Wq5Z7CjrBsqxgrbw@mail.gmail.com>
[-- Attachment #1.1.1: Type: text/plain, Size: 6862 bytes --]
On 29-01-2023 04:04, Blake Shaw wrote:
>
>
>
> On 26-01-2023 19:57, Blake Shaw wrote:
> > @example
> > -(match lst
> > - (((heads tails ...) ...)
> > - heads))
> > +(match '(((a b c) e f g) 1 2 3)
> > + (((head ...) tails ...)
> > + `(,@tails ,head)))
> > +@result{} (1 2 3 ((a b c) e f g))
> > @end example
>
>
> >>Contrary to the commit message, this >>isn't an addition of a
> pattern
> >>matching example, it's a change.
> >>Aside from inlining 'lst', what's this >>change for?
>
>
> The offered example cant be executed. Its up to the reader to figure
> out, which isn't valuable to anyone trying to understand the matcher in
> first place. Again, ee the linked presentation for much on these matters
> and more.
The offered example indeed can't be executed. However, inlining 'lst'
is sufficient to make it execute (*), and I asked for ‘**aside from
inlining** 'lst', what's this change for?’ (emphasis added).
(*) E.g. take lst = '((x) (y y0) (z z1 z2)):
(match '((x) (y y0) (z z1 z2)):
(((heads tails ...) ...)
heads))
> If you look at the example, it should be clear what this illustrates
> while the other lacks, it seems obvious and im unsure what your are
> missing tbh.
Aside from the inlining, it absolutely isn't clear. Aside from the
inlining, your new example is less clear to me -- e.g., why does 'tails'
have ,@ and 'head' have ',', instead of both having ',@' or both having ','?
What I'm missing is, why did you change
(((heads tails ...) ...)
heads))
to
(((head ...) tails ...)
`(,@tails ,head)))
?
If it is clear and obvious to you what this change is for, then please
actually say what it is for instead of stating that it is obvious.
AFAIK, the presentation did not explain what this (*non-inlining*)
change is for. If it did, then you need to say at which minute+second
-- unlike text, you can't really skim through videos.
> > +A pattern matcher can match an object against several patterns and
> > +extract the elements that make it up.
> > +
> > +@example
> > +(let ((m '((a . b) (c . d) (e . f))))
> > + (match m
> > + (((left . right) ...) left)))
> > +@result{} (a c e)
> > +@end example
>
> There is only a single pattern here, not several patterns.
> Several patterns would be, e.g.,
>
>
> (let ((m '(#(a b) #(c d) #(e f)))
> (match m
> (((left . right) ...) left)
> ((#(left right) ...) left))).
>
>
> Sorry, but you are wrong. What you are calling patterns are pattern
> clauses. Left and right here are pattern variables bound to patterns.
> See SRFI-204 on the Shinn Pattern matcher which (ice-9 match) more or
> less implements https://srfi.schemers.org/srfi-204/srfi-204.html
> <https://srfi.schemers.org/srfi-204/srfi-204.html>
OK, terminology difference. It's still wrong though, in a different way
-- you write that an object is matched against several patterns.
However, there is no 'or', 'and' or multiple clauses anywhere in your
example, so the object ((a . b) (c . d) (e . f)) is only matched against
a single pattern (((left . right) ...) left), and likewise its elements
(a . b), (c . d), ... are only matched against a single clause (left .
right), etc..
Proposal: 'several patterns -> a pattern' (which happens to consist of
smaller patterns).
>
> > +Patterns can represent any Scheme object: lists, strings, symbols,
> > +records, etc.
>
> Missing end-of-sentence period. The . in 'etc.' is part of the
> abbreviation 'etc.', not an end-of-sentence marker. I know it's
> 'standard' English (for some value of 'standard' in English) to
> conflate
> all the dots, but we don't have to follow standard when they are buggy.
>
> (This is like the example at
> <https://catb.org/jargon/html/writing-style.html
> <https://catb.org/jargon/html/writing-style.html>> about not moving the
> end-of-sentence period inside quotation marks:
>
> Then delete a line from the file by typing “dd”.
>
> Then delete a line from the file by typing “dd.”
>
> -- while in this particular case (i.e., 'etc.') the distinction is
> unimportant, for consistency with other cases where the distinction is
> important, I would go for '..., symbols, records, etc..'.
>
>
> I'm sorry but again, this is simply bad style and incorrect suggestions.
> According to the MLA, the authority on English style:
It appears to be _an_ authority, but certainly not _the_ authority.
I believe it's common knowledge there is no central authority on English.
> "A sentence should never have two periods at the end. If a sentence ends
> with an abbreviation followed by a period, do not add an additional period:
>
>
> She explained the rules for periods, commas, semicolons, etc."
>
> Thats MLA's example of the correct way of how to end a sentence with
> punctuated abbreviation.
It appears you disagree that dots shouldn't be merged, but you aren't
giving a proper argument for your position or a counter-argument to my
argument -- with your reference to MLA, you were making an appeal to
authority, which on its own is an argument, but:
* I already anticipated the potential argument:
‘I know it's 'standard' English (for some value of 'standard' in
English) to conflate all the dots, but ...’.
(In this case, 'standard' = 'MLA', though it would apply to
many other authorities too.)
-- you aren't saying anything new here.
* I also already refuted it (‘but ... This is like the example at
...’, with a link to a document that explains in some detail the
reasoning behind it.)
* You can't counter an argument by authority (in my case, the
Jargon file) by another argument by authority (in your case,
the MLA). Instead you need to argue which one of the authorities
is right or wrong -- the fragment of the Jargon file I referred
to gives some explanation, whereas your quote of the MLA just
states things without explaining a thing, so the Jargon file
'wins' by default.
You could instead quote a part of the MLA style guide that actually
explains ‘why merging periods is good’ (I doubt such an explanation in
the MLA style guide actually exists but I could be pleasantly
surprised), or say something like 'While in some rare situations,
potential confusion might exist, I still prefer merging periods, and in
matters of taste there can be no disputes.', but not this.
Greetings,
Maxime.
[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 929 bytes --]
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 236 bytes --]
next prev parent reply other threads:[~2023-01-29 15:30 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-26 18:57 [PATCH v1 1/6] docs/match: add pattern matching examples Blake Shaw
2023-01-26 18:57 ` [PATCH v1 2/6] docs/match: rm unquote-splicing as it interferes with textinfo Blake Shaw
2023-01-27 16:27 ` Maxime Devos
2023-01-28 9:14 ` Blake Shaw
2023-01-28 13:08 ` Maxime Devos
2023-01-29 3:09 ` Blake Shaw
2023-01-26 18:57 ` [PATCH v1 3/6] docs/match: add reverse nested list example Blake Shaw
2023-01-26 18:57 ` [PATCH v1 4/6] docs/match: match-let* unwrap example Blake Shaw
2023-01-26 18:58 ` [PATCH v1 5/6] docs/fixup: @cindex was in the wrong place Blake Shaw
2023-01-26 18:58 ` [PATCH v1 6/6] docs/match:style reviewing with pdf, adding newlines Blake Shaw
2023-01-28 13:18 ` [PATCH v1 1/6] docs/match: add pattern matching examples Maxime Devos
2023-01-28 19:10 ` randomlooser
2023-01-28 19:23 ` randomlooser
[not found] ` <CAKjmbcA9TeuC0HWE53cG4EfautTcW5s9tyh0tCXUvicAQiBFKQ@mail.gmail.com>
2023-01-29 14:23 ` Maxime Devos
2023-01-28 13:48 ` Maxime Devos
[not found] ` <CAKjmbcAucYA9j7suY1gEAO512pn+90ED33Wq5Z7CjrBsqxgrbw@mail.gmail.com>
2023-01-29 15:30 ` Maxime Devos [this message]
2023-01-30 0:49 ` Blake Shaw
2023-01-30 19:56 ` Aleix Conchillo Flaqué
2023-01-30 19:57 ` Aleix Conchillo Flaqué
2023-01-31 2:53 ` Maxime Devos
2023-01-31 3:59 ` Aleix Conchillo Flaqué
2023-01-31 2:28 ` [PATCH v1 1/6] docs/match: add pattern matching examples + CoC Maxime Devos
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
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=9a5ee863-c768-4109-3323-908adc277479@telenet.be \
--to=maximedevos@telenet.be \
--cc=blake@sweatshoppe.org \
--cc=guile-devel@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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).