unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Marco Maggi <marco.maggi-ipsu@poste.it>
To: Panicz Maciej Godek <godek.maciek@gmail.com>
Cc: guile-user@gnu.org
Subject: Re: Pattern matching issues
Date: Wed, 13 Jul 2011 07:40:38 +0200	[thread overview]
Message-ID: <87wrfmzqjt.fsf@rapitore.luna> (raw)
In-Reply-To: marco.maggi-ipsu@poste.it (Panicz Maciej Godek's message of "Tue, 12 Jul 2011 23:05:26 +0200")

Panicz Maciej Godek wrote:

> I've been  wondering if there  is a way to  represent this
> sort of pattern for the pattern matcher provided by Wright
> (and Guile).

The syntax should be something like:

(match '(Mr Hulot and I need a vacation)
  ((?x ... 'need ?y ...)
   (write (list ?x ?y))
   (newline)))

but at  present multiple ellipses  are not supported  at the
same level  (that is in the  same list or  the same vector).
It is  possible to do  it, but a  policy (greedy/non-greedy)
must  be  adopted  to  solve  ambiguous cases  and  it  gets
complicated.

HTH
-- 
Marco Maggi



  parent reply	other threads:[~2011-07-13  5:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-12 21:05 Pattern matching issues Panicz Maciej Godek
2011-07-12 22:21 ` Ludovic Courtès
2011-07-13  5:40 ` Marco Maggi [this message]
2011-07-13 10:42   ` Panicz Maciej Godek
2011-07-23 18:44 ` Linas Vepstas
2011-07-25 10:44   ` Andy Wingo

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=87wrfmzqjt.fsf@rapitore.luna \
    --to=marco.maggi-ipsu@poste.it \
    --cc=godek.maciek@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).