From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Marco Maggi Newsgroups: gmane.lisp.guile.user Subject: Re: Pattern matching issues Date: Wed, 13 Jul 2011 07:40:38 +0200 Message-ID: <87wrfmzqjt.fsf@rapitore.luna> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1310535468 24166 80.91.229.12 (13 Jul 2011 05:37:48 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 13 Jul 2011 05:37:48 +0000 (UTC) Cc: guile-user@gnu.org To: Panicz Maciej Godek Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Wed Jul 13 07:37:44 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 1Qgs8m-0004hL-GD for guile-user@m.gmane.org; Wed, 13 Jul 2011 07:37:44 +0200 Original-Received: from localhost ([::1]:56398 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qgs8l-000217-Eg for guile-user@m.gmane.org; Wed, 13 Jul 2011 01:37:43 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:48018) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qgs8a-00020r-3v for guile-user@gnu.org; Wed, 13 Jul 2011 01:37:32 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qgs8Z-0004zI-Cc for guile-user@gnu.org; Wed, 13 Jul 2011 01:37:32 -0400 Original-Received: from relay-pt1.poste.it ([62.241.4.164]:52877) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qgs8Z-0004zE-7P for guile-user@gnu.org; Wed, 13 Jul 2011 01:37:31 -0400 Original-Received: from rapitore.luna (93.147.77.46) by relay-pt1.poste.it (8.5.121.01) (authenticated as marco.maggi-ipsu@poste.it) id 4E1CD2720000A949; Wed, 13 Jul 2011 07:37:28 +0200 Original-Sender: marco.maggi-ipsu@poste.it X-Loop: marco@maggi.it.invalid X-Mailer: GNU Emacs In-Reply-To: marco.maggi-ipsu@poste.it (Panicz Maciej Godek's message of "Tue, 12 Jul 2011 23:05:26 +0200") Original-Lines: 22 X-detected-operating-system: by eggs.gnu.org: Solaris 9 X-Received-From: 62.241.4.164 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:8682 Archived-At: 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