Skip Menu |
 

This queue is for tickets about the Filter-Template CPAN distribution.

Report information
The Basics
Id: 18341
Status: rejected
Priority: 0/
Queue: Filter-Template

People
Owner: RCAPUTO [...] cpan.org
Requestors: rcaputo [...] pobox.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Re: Using commas in POE::Preprocessor macros
Date: Wed, 29 Sep 2004 17:07:45 -0400
To: "Westendorf, John" <JWestendorf [...] ea.com>
From: Rocco Caputo <rcaputo [...] pobox.com>
Download (untitled) / with headers
text/plain 1.8k
On Wed, Sep 29, 2004 at 12:34:34PM -0700, Westendorf, John wrote: Show quoted text
> Mr. Caputo: > > Hi, my name is John Westendorf, and I am thinking of using > POE::Preprocessor macros in my current Perl project. Is there a > special > meta-character or anything to allow me to input commas into a > macro? So, > in a simplistic example, I could have a line like > > {% macro "blahblah comma-meta-character blahblah" %} > > which would send in "blahblah , blahblah" as the first macro argument? > Thanks! > > - John Westendorf
Good morning, John. In an ideal world, the macro parser would know Perl syntax and detect that the comma is in a literal string. Parsing Perl is terribly NOT easy, however. It is sensible to run screaming when faced with the need for it. Adding to the macro syntax is interesting. Some really fantastic (but off-topic) things can be done with that. It doesn't seem right that strings must be modified when they're used in macro invocations, though. Perhaps the preprocessor could recognize different separator characters. If the macro name is immediately followed by a valid separator, then that's used to separate the invocation parameters. {% macro ; "blahblah , blahblah" %} # separate with semicolon {% macro , "blahblah , blahblah" %} # separate with comma (default) {% macro | "blahblah , blahblah" %} # separate with pipe That's extensible, and it doesn't put the onus of parsing Perl on POE::Preprocessor, but it can break existing code in obscure situations (where | is the first parameter, for example). Backward compatibility can be preserved, though, if separators are only permitted to contain commas: {% macro ,, "blahblah , blahblah" %} # separate with ",," {% macro ,,, "blahblah , blahblah" %} # separate with ",,," {% macro ,,,, "blahblah , blahblah" %} # separate with ",,,," etc. What do you think? -- Rocco Caputo - http://poe.perl.org/


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.