ANN: Introducing PLY-1.0 (Python Lex-Yacc)

phil hunt philh at comuno.freeserve.co.uk
Wed Jun 20 09:44:04 EDT 2001


On Wed, 20 Jun 2001 07:57:32 -0500 (CDT), David Beazley <beazley at cs.uchicago.edu> wrote:
>M.-A. Lemburg writes:
> > 
> > Just a suggestion: PLY seems to use the same logic for attaching
> > grammar snippets to functions as SPARK does. IMHO, this is bad
> > design since doc-strings should really only be used for documentation
> > and not include vital information for the program logic.
>
>Actually, I thought the doc string hack was one of the neatest
>programming tricks I've ever seen (which is exactly why I copied it
>from SPARK).  Why would I write a different documentation string for a
>grammar rule anyways?  The grammar rule in the docstring not only
>tells the parser generator what to do, but it precisely documents what
>the function does at the same time.  I don't know what inspired John
>to take this approach in SPARK, but it's pure genius if you ask me :-).

Yeah, it certainly wouldn't have occurred to me (a happy SPARK user).

-- 
##  Philip Hunt                   ##
##  philh at comuno.freeserve.co.uk  ##






More information about the Python-list mailing list