unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Vivien Kraus <vivien@planete-kraus.eu>
To: Damien Mattei <damien.mattei@gmail.com>, guile-user <guile-user@gnu.org>
Subject: Re: comparator in match pattern
Date: Wed, 28 Jun 2023 15:55:43 +0200	[thread overview]
Message-ID: <fc7000eea86586ee3e7cae08fe9febc02f4cf979.camel@planete-kraus.eu> (raw)
In-Reply-To: <e59054af35f36df061bc520cef9d49f8cb6060be.camel@planete-kraus.eu>

Le mercredi 28 juin 2023 à 15:51 +0200, Vivien Kraus a écrit :
> So, you want to match against the / symbol, not the value of a
> variable
> named /?

Sorry, I misread. You actually have a variable named /.

So this code is the only relevant one:

(use-modules (ice-9 match) (srfi srfi-26))
(let ((/ 42)) 
  (match (list 1 42) 
    ((c (? (cut equal? <> /))) 
     c)))

Vivien



  reply	other threads:[~2023-06-28 13:55 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-28  8:44 comparator in match pattern Damien Mattei
2023-06-28  8:55 ` Vivien Kraus
2023-06-28 13:38   ` Damien Mattei
2023-06-28 13:51     ` Vivien Kraus
2023-06-28 13:55       ` Vivien Kraus [this message]
2023-06-28 15:10         ` Damien Mattei
2023-06-28 15:31           ` Vivien Kraus
2023-06-28 19:47             ` Damien Mattei
2023-06-28 20:52               ` Damien Mattei

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=fc7000eea86586ee3e7cae08fe9febc02f4cf979.camel@planete-kraus.eu \
    --to=vivien@planete-kraus.eu \
    --cc=damien.mattei@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).