unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
To: <guile-user@gnu.org>
Subject: Vector pattern matching problem when using ..1
Date: Tue, 31 May 2022 00:07:43 -0400	[thread overview]
Message-ID: <87bkves5tc.fsf@gmail.com> (raw)

Hello Guilers!

I've been trying to what seems to be a behavior discrepancy/bug in the
(@@ (ice-9 match) match) syntax.  Consider:

--8<---------------cut here---------------start------------->8---
> (match #(1 2) (#(x ..1) x))
--8<---------------cut here---------------start------------->8---
$1 = 1

But:

--8<---------------cut here---------------end--------------->8---
(match #(1 2 3) (#(x ..1) x))
ice-9/boot-9.scm:1685:16: In procedure raise-exception:
Throw to key `match-error' with args `("match" "no matching pattern" #(1 2 3))'.

Entering a new prompt.  Type `,bt' for a backtrace or `,q' to continue.
--8<---------------cut here---------------end--------------->8---

Changing ..1 which is supposed to mean 1 or more (of the previous
pattern) fixes it.

Is this expected or a bug?

Thank you!

Maxim



                 reply	other threads:[~2022-05-31  4:07 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=87bkves5tc.fsf@gmail.com \
    --to=maxim.cournoyer@gmail.com \
    --cc=guile-user@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).