Re: Mason 2.0 thoughts
Jonathan Swartz <[email protected]> Sun, 13 May 2007 16:21:49 -0700
| Newsgroups | gmane.comp.web.mason.devel |
|---|---|
| Message-ID | <[email protected]> |
> I totally agree. In my Mason 2.0 notes, I mentioned that I wanted to > extend the CWC feature to allow calling a subroutine, something > like how > TT2 does filters. > > <&| caching_subroutine(), ... &> > > [content] > > </&> > > Which is a lot like TT: > > [% USE foo = Filter::Foo %] > [% FILTER foo(...) %] > > some content > > [% END %] > >> So IMO it would be great to have a special syntax for these >> filters (or to >> co-opt an existing syntax like <% %>), a syntax that was nestable, >> and not >> line-based, and able to handle arbitrary Perl arguments. > > THe CWC syntax is exactly that syntax! > >> Given that, it is somewhat unfortunate IMO that we came up with >> CWC first, >> because such a new syntax would be blamed for cluttering the Mason >> language >> unnecessarily, whereas in retrospect I'd rather have a module- >> based filter >> syntax than CWC. > > I think we're on basically the same page. I'm just saying that we > can use > the syntax we have, but extend it to allow calling subroutines, > components, and "named" filters. Now, I don't know exactly how we'd > distinguish all of them, but I like the idea. Ok, we are basically on the same page. Sorry I missed that line in the Mason 2.0 notes. Had I seen that I wouldn't have felt the need to do quite as much convincing. Ah well, it felt good to say all that. :) Expanding the <& |&> syntax is fine with me, though definitely a little unintuitive given that that <& &> always been exclusively for component calls. But at this point we aren't going to be able to introduce any new syntax this major without a little confusion and grumbling from the Mason old-timers, I expect. :) Jon ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/