Re: Modifiers and variables
William McKee <[email protected]>
| Newsgroups | gmane.comp.lang.perl.modules.petal |
|---|---|
| Message-ID | <[email protected]> |
> I see. Well, I wouldn't adding a base class (i.e. Petal::Plugin) which > would be the recommended method to implement new modifiers, and then > cabling existing modifiers onto Petal::Plugin. Error: Can't parse statement. Is this valid English? > I don't really see the advantage of /enforcing/ this syntax though. What > happens when you DO want your own syntax? At the moment the string: > modifier is quite important to me as I use it in conjunction with a > translation service (if there is one). > > In other words, I am confused and I'm not sure :-) If you take a look at Petal::Utils::Printf, you'll see that it gets the entire arguments statement then calls a subroutine to do the parsing. This subroutine is what I'd like to see added to Petal. Steve has commented to me that he thinks much of the Petal::Utils framework can be included in Petal. However, he's more fluent in that framework than I am, so we're going to have to wait for him to chime in if/when he has a moment. I really like having a set of useful modifiers available in a single package so suspect that Petal::Utils will stick around for some time to come. > >I'm not sure that I follow what you mean by an abstract modifier. Would > >my custom modifier inherit from that? If so, this is essentially what > >Petal::Utils is doing now. > > > Looks like it's time to go steal some code from there... Be sure to grab the latest prerelease from SF[1]. I'd appreciate your feedback. > >I was hoping to have a standard method for > >extracting the arguments from the string but migrating the Plugin > >modifier architecture from Petal::Utils into Petal would be great (I > >know Steve would be all for this). > > > But surely the abstract class then becomes the standard method. Except > that if you don't want to use the standard method, well, you don't have > to. Does it make sense? It makes sense but again I'm not too familiar with the framework so can't see clearly how it would fit into Petal. It'd be great to have though! > Well, " string: " is also implemented by ZPT. They also implement > python: but I think it's a mistake so I made a conscious decision NOT to > implement 'perl:', although it would be trivial. So far, I've tended to agree which is why you won't find a perl: modifier in Petal::Utils. Regards, William [1] http://sourceforge.net/projects/petal-utils/ -- Knowmad Services Inc. http://www.knowmad.com