[m-rev.] For review: State Variable Transformation

Fergus Henderson fjh at cs.mu.OZ.AU
Tue May 7 17:40:28 AEST 2002


On 07-May-2002, Ralph Becket <rafe at cs.mu.OZ.AU> wrote:
> Fergus Henderson, Tuesday,  7 May 2002:
> > If you want to make some parenthetical suggestions about programming style,
> > I don't object to that, so long as they are clearly labelled as such.
> 
> I think it's important to say something along these lines.

OK.

> How about:
> 
> 	(DCG notation is intended for writing a particular style of
> 	parser; in the past it has also been used in non-parsing code to
> 	thread an implicit state variable, typically the IO state,
> 	through code.  As a matter of style, we recommend that in future
> 	DCG notation be reserved for parsing and that state variable
> 	syntax be used for passing state threads.)

I don't agree that DCG notation should only be used for parsing.
DCG should only be used for grammars, sure, but it's quite reasonable
to use DCGs in the "inverse mode" to *generate* sequences rather than
to *parse* them.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list