From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Linas Vepstas Newsgroups: gmane.lisp.guile.user Subject: Re: Pattern matching issues Date: Sat, 23 Jul 2011 13:44:04 -0500 Message-ID: References: Reply-To: linasvepstas@gmail.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: dough.gmane.org 1311446674 12280 80.91.229.12 (23 Jul 2011 18:44:34 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 23 Jul 2011 18:44:34 +0000 (UTC) Cc: guile-user@gnu.org To: Panicz Maciej Godek Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Sat Jul 23 20:44:30 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 1QkhBe-0003gU-JS for guile-user@m.gmane.org; Sat, 23 Jul 2011 20:44:30 +0200 Original-Received: from localhost ([::1]:51348 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QkhBe-0004sk-5s for guile-user@m.gmane.org; Sat, 23 Jul 2011 14:44:30 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:52057) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QkhBb-0004sc-OZ for guile-user@gnu.org; Sat, 23 Jul 2011 14:44:28 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QkhBZ-00085N-SQ for guile-user@gnu.org; Sat, 23 Jul 2011 14:44:27 -0400 Original-Received: from mail-fx0-f52.google.com ([209.85.161.52]:50282) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QkhBZ-000857-Jl for guile-user@gnu.org; Sat, 23 Jul 2011 14:44:25 -0400 Original-Received: by fxd18 with SMTP id 18so5672155fxd.39 for ; Sat, 23 Jul 2011 11:44:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:reply-to:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=inHJwaLGdsr4IJQfvw1k7cGWPqSNRgNcOs5egSMvUTI=; b=Bk26bERrB3dVo0AOh/4PxM4DJR+qc00zRjf94eanS57GVQkzrIbYfc6hQwSfsOCAJm BG7ZYsY10nMep+zWQPEr1RYNVj8PihFJUUXvy+3lHOU+rLVSiGfRX678VgT+3G1D3G3K 69bg5eg9iBUvBw5vF3UirZNSjBVMTJJ9IhvwQ= Original-Received: by 10.223.64.80 with SMTP id d16mr4079664fai.86.1311446664128; Sat, 23 Jul 2011 11:44:24 -0700 (PDT) Original-Received: by 10.223.74.198 with HTTP; Sat, 23 Jul 2011 11:44:04 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.161.52 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:8692 Archived-At: On 12 July 2011 16:05, Panicz Maciej Godek wrote: > As we all know, The guile module (ice-9 match) includes an > implementation for a pattern matcher as specified by Andrew K. Wright. > I've recently been reading a book by Peter Norvig, where he came up > with the following notation for what he called "Segment Pattern > Matching" (in Common Lisp): > > (pat-match '((?* ?p) need (?* ?x)) '(Mr Hulot and I need a vacation)) out of curiosity, do either the guile pattern matcher, or Norvig's, operate on structures (lists of lists, etc) rather than just on strings? Just asking out of curiosity; I maintain a pattern matcher for a different project; it does pattern matching on arbitrary directed graphs (equivalently, more or less, on terms in a term algebra). Its used to implement queries against a database-like collection of terms. (this is for the OpenCog project) --linas