guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Names for PEG Functions


From: Andy Wingo
Subject: Re: Names for PEG Functions
Date: Wed, 21 Sep 2011 22:45:04 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux)

Hi,

On Wed 21 Sep 2011 22:13, Noah Lavine <address@hidden> writes:

> define-peg-sexp - define a nonterminal from an s-expression
> define-peg-string - define a set of nonterminals from a string

To me this sounds like you are defining an sexp or a string, which
doesn't make much sense.  I don't think that we need to preserve
symmetry here, because the first binds one identifier, whereas the
second binds a number of identifiers.  (Is that really necessary?  It
would be nicer if it just bound one identifier, or something.  Dunno.)

Also, are the different `accum' things necessary?  Just wondering.
Unused bindings will probably be removed by the optimizer.

> compile-peg-sexp - compile an sexp to a nonterminal (an opaque value
> to the user, but really just a function)

compile-peg-pattern perhaps ?

> compile-peg-string - compile a string to a nonterminal

compile-peg-string-pattern ?

> match-peg - match a peg to a string, starting at the beginning

match-pattern ?

> search-peg - match a peg to a string, starting at each index in turn
> until we find a match or reach the end

search-for-match ?

> I realize that putting 'peg' in the names isn't really necessary
> because the user could use a module renamer, as Ludovic pointed out a
> few days ago. I put 'peg' in the define-* syntax because I thought
> 'define-sexp' and 'define-string' were too general as names, and then
> I wanted the compile-* functions to be consistent with them. As for
> the others, 'match' and 'search' seemed too general.

Yeah, dunno.  What do you think about these names?  Please don't take
these suggestions too seriously.

> Looking forward to merging this,

Yeah!

Andy
-- 
http://wingolog.org/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]