From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andy Wingo Newsgroups: gmane.lisp.guile.devel Subject: Re: PEG Patches Date: Tue, 29 Mar 2011 10:00:08 +0200 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1301385614 30139 80.91.229.12 (29 Mar 2011 08:00:14 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 29 Mar 2011 08:00:14 +0000 (UTC) Cc: guile-devel To: Noah Lavine Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Tue Mar 29 10:00:09 2011 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Q4TqS-00028P-7z for guile-devel@m.gmane.org; Tue, 29 Mar 2011 10:00:08 +0200 Original-Received: from localhost ([127.0.0.1]:60451 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q4TqQ-0007fZ-4M for guile-devel@m.gmane.org; Tue, 29 Mar 2011 04:00:06 -0400 Original-Received: from [140.186.70.92] (port=46577 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q4TqF-0007fQ-Qs for guile-devel@gnu.org; Tue, 29 Mar 2011 03:59:57 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q4TqD-000193-PQ for guile-devel@gnu.org; Tue, 29 Mar 2011 03:59:55 -0400 Original-Received: from a-pb-sasl-sd.pobox.com ([64.74.157.62]:39945 helo=sasl.smtp.pobox.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q4TqD-00018s-N0 for guile-devel@gnu.org; Tue, 29 Mar 2011 03:59:53 -0400 Original-Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTP id B231E2A8D; Tue, 29 Mar 2011 04:01:39 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=sasl; bh=WTYILmv6FrMdVcb2a9sDwQedSnU=; b=YPpagm rE4h6qMwPvt6yQh2JSSRezy7gFUwOilyVnNYj05iEjtBoupQFUOrvmYD5CiyEwf0 1gMiCatwPFnVa5QxYGbL5lO0RTXkS4b6kF1/ZwUr14yH2Z909HK+qb6pCCsl1hP+ 1iLgOJoZpvgoxqnx7dFAFrvbYB4INdAKBH3GM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=sasl; b=ntTG7+x+s8gHMLVZVskDZ4g7wjJNLoB4 zoJJR37Ve9434Ubxz31xT3RjFaBtXl8jXG/lZPu2bqd7TLk1K+t1ImaookiMntv+ TB6X0EtQ6HSC/Ze6l3l6nTupEeSDvUjOmYJlHAN8krmqfI6IT9r10vOHcYSH+GpF ZPFQCdSuUU0= Original-Received: from a-pb-sasl-sd.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTP id 9F7FC2A8C; Tue, 29 Mar 2011 04:01:37 -0400 (EDT) Original-Received: from unquote.localdomain (unknown [90.164.198.39]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTPSA id B1A7F2A89; Tue, 29 Mar 2011 04:01:35 -0400 (EDT) In-Reply-To: (Noah Lavine's message of "Mon, 28 Mar 2011 16:44:37 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) X-Pobox-Relay-ID: C5B240D6-59DA-11E0-810E-E8AB60295C12-02397024!a-pb-sasl-sd.pobox.com X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-Received-From: 64.74.157.62 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:12037 Archived-At: On Mon 28 Mar 2011 22:44, Noah Lavine writes: > - say that string PEGs can only occur at the top level of a PEG > expression. The peg module has never been released, so no one uses > this feature now anyway. > - instead of defining a new function peg-extended-compile, redefine > peg-sexp-compile via set! once we have string pegs. > - write peg-extended-compile as its own big case statement, basically > duplicating peg-sexp-compile. > - adopt some interface that allows people to extend the cases in > peg-sexp-compile. We would start with just s-expression PEGs, then use > this interface to add string PEGs later in the load sequence. This last is the best. What if we define a module that serves as a registry of PEG match behaviors, like `(ice-9 peg matchers)'. Then we define `define-peg-matcher' or something, so that we can: (define-peg-matcher and cg-and) where define-peg-matcher is (define-syntax define-peg-matcher (syntax-rules () ((_ name binding) (module-define! (resolve-module '(ice-9 peg matchers)) 'name binding)))) Then instead of defining separate cases for ignore, range, etc the peg-sexp-compile macro does: ((matcher arg ...) (identifier? #'matcher) ((module-ref (resolve-module '(ice-9 peg matchers)) (syntax->datum #'matcher)) #'(arg ...) mode)) Then the peg-string module registers a matcher for `peg'. Dunno. WDYT? Andy -- http://wingolog.org/