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

Required Named Params and "go write your own grammar"

Thread Next
Abhijit A. Mahabal
May 4, 2004 08:27
Required Named Params and "go write your own grammar"
Message ID:
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

"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 A. Mahabal

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About