develooper Front page | perl.perl6.language | Postings from May 2004

Required Named Params and "go write your own grammar"

Thread Next
From:
Abhijit A. Mahabal
Date:
May 4, 2004 08:27
Subject:
Required Named Params and "go write your own grammar"
Message ID:
Pine.GSO.4.58.0405041013231.24061@prickly.cs.indiana.edu
As I try writing P6 programs I do find myself needing required named
params, and I thought I'd like something like ++$named_req for myself as a
shorthand for "+$named_req is required" or whatever is decided.

Now, larry often says (only partly jokingly) "go write your own grammar".
But I do not know how I'd change/modify/append the grammar to accomodate
that cosmetic change above. Needing to know "the entire P6 grammar"
isn't mouth watering. I am sure this has been discussed before, so can
somebody please point me to some place where I can start reading about
this?

"macros" does not seem to be an answer as I seem to think of them as
defining syntax for new commands that you are writing. (In this case, I do
not know where I would put the "is parsed" trait). I may be wrong and
macros in some form are the answer. Either way, I'd appreciate any
thoughts/answers/pointers on this.

--Abhijit

Abhijit A. Mahabal      http://www.cs.indiana.edu/~amahabal/

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About