From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Panicz Maciej Godek Newsgroups: gmane.lisp.guile.user Subject: Re: Pattern matching issues Date: Wed, 13 Jul 2011 12:42:09 +0200 Message-ID: References: <87wrfmzqjt.fsf@rapitore.luna> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1310554192 29798 80.91.229.12 (13 Jul 2011 10:49:52 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 13 Jul 2011 10:49:52 +0000 (UTC) Cc: guile-user@gnu.org To: Marco Maggi Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Wed Jul 13 12:49:48 2011 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Qgx0m-0006m7-Gt for guile-user@m.gmane.org; Wed, 13 Jul 2011 12:49:48 +0200 Original-Received: from localhost ([::1]:59498 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qgx0l-0000Tg-3j for guile-user@m.gmane.org; Wed, 13 Jul 2011 06:49:47 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:43224) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QgwtS-0007hS-OK for guile-user@gnu.org; Wed, 13 Jul 2011 06:42:18 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QgwtO-0007yi-Dj for guile-user@gnu.org; Wed, 13 Jul 2011 06:42:14 -0400 Original-Received: from mail-vw0-f41.google.com ([209.85.212.41]:52769) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QgwtN-0007yT-Rc for guile-user@gnu.org; Wed, 13 Jul 2011 06:42:10 -0400 Original-Received: by vws4 with SMTP id 4so5278405vws.0 for ; Wed, 13 Jul 2011 03:42:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=WmrlQrkmTPp3UAjv6SihBvlUN3+VqoDqLsYG50qnWPA=; b=RvAiIyJGfVjItACcieWrK2ljRf96whq+3j5Bz/TDZ7UTiWmSyFMQiwWfdClBDQlS7W 6lu18fR6ZVSb2CE4/JUUXbt26DwMQgGN5c1taellJzS/8QCcSt51gpMy0T9eZ1QVvVof hYRsymzrAgO/QwDjo3oI+/qMu+0r65JDpOqE0= Original-Received: by 10.52.73.34 with SMTP id i2mr1016435vdv.166.1310553729092; Wed, 13 Jul 2011 03:42:09 -0700 (PDT) Original-Received: by 10.220.182.129 with HTTP; Wed, 13 Jul 2011 03:42:09 -0700 (PDT) In-Reply-To: <87wrfmzqjt.fsf@rapitore.luna> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.212.41 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:8683 Archived-At: 2011/7/13 Marco Maggi : > Panicz Maciej Godek wrote: > >> I've been =A0wondering if there =A0is a way to =A0represent 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) > =A0((?x ... 'need ?y ...) > =A0 (write (list ?x ?y)) > =A0 (newline))) > > but at =A0present multiple ellipses =A0are not supported =A0at the > same level =A0(that is in the =A0same list or =A0the same vector). > It is =A0possible to do =A0it, but a =A0policy (greedy/non-greedy) > must =A0be =A0adopted =A0to =A0solve =A0ambiguous cases =A0and =A0it =A0g= ets > complicated. I agree that it could get complicated for the ambiguous cases, but it should at least be possible for the simple ones. I think that the lack of this capability is a serious limitation of a pattern matcher. I'm not well acquainted with regular expressions, but I could try to resolve this issue upon the book that I'm currently reading -- provided that there's no one dealing with it at the moment Regards M.