unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* Names for PEG Functions
@ 2011-09-21 20:13 Noah Lavine
  2011-09-21 20:45 ` Andy Wingo
  0 siblings, 1 reply; 9+ messages in thread
From: Noah Lavine @ 2011-09-21 20:13 UTC (permalink / raw)
  To: guile-devel

Hello all,

As the PEG module nears some reasonable level of completion, we should
figure out what all of the functions need to be named so everyone can
reasonably understand them.

At first I thought the names should be consistent wtih the LALR and
regexp modules, so all of the parsing modules would agree. But after
looking at those two, I realized that they aren't consistent with each
other, so it would be very difficult to make PEG match them.

At least, however, PEG can be consistent with itself. Therefore I
suggest the following names and meanings:

define-peg-sexp - define a nonterminal from an s-expression
define-peg-string - define a set of nonterminals from a string
compile-peg-sexp - compile an sexp to a nonterminal (an opaque value
to the user, but really just a function)
compile-peg-string - compile a string to a nonterminal
match-peg - match a peg to a string, starting at the beginning
search-peg - match a peg to a string, starting at each index in turn
until we find a match or reach the end

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.

The verb comes first in all of these because I think putting 'define'
in the beginning of syntax that defines things is standard, and then I
made the other names to match that one. If anyone has better ideas,
though, I'm not attached to these names.

Looking forward to merging this,
Noah



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2012-01-22 20:15 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-21 20:13 Names for PEG Functions Noah Lavine
2011-09-21 20:45 ` Andy Wingo
2011-09-22 17:56   ` Noah Lavine
2011-10-04  0:21     ` Noah Lavine
2012-01-04 18:12       ` Andy Wingo
2012-01-19  9:53         ` Andy Wingo
2012-01-19 13:54           ` Noah Lavine
2012-01-20  3:18             ` Noah Lavine
2012-01-22 20:15               ` Noah Lavine

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).