[Catalyst] Re: How to access current MyApp instance ?

Jonathan Rockway jon at jrock.us
Wed Jul 4 23:53:06 GMT 2007


On Sunday 01 July 2007 02:27:17 pm A. Pagaltzis wrote:
> Of course, we’ve known since the ’70s or so how to make better
> programming languages, but ABW considers templating languages
> to be totally different from programming languages, so you get
> to be transported back to the ’60s.

I agree that this is a terrible way to do things.  Perl has the right idea 
with $sigils, so at least &functions look different from other @things.  Oh, 
and you know... a lexical scope.

I've personally been burned with this in ircxory*:

[% MACRO thing(thing) BLOCK %] 
<a class="thing" href="[% c.uri_for('/things',thing) | html%]">
  [% thing | html %]</a>
[% END %]

Then:
<ul>
[% WHILE (thing = things.next) %]
  <li>[% thing(thing.name) %] [% score(thing.score) %]</li>
[% END %]
</ul>

Oops, that breaks.  

Now my variables have really icky names to work around that, but it has made 
me consider ditching TT.  Unfortunately I don't like the alternatives 
either :)  Maybe T::Declare...

* http://git.jrock.us/?p=ircxory.git;a=summary or "git clone 
git://git.jrock.us/ircxory"

Regards,
Jonathan Rockway

-- 
package JAPH;use Catalyst qw/-Debug/;($;=JAPH)->config(name => do {
$,.=reverse qw[Jonathan tsu rehton lre rekca Rockway][$_].[split //,
";$;"]->[$_].q; ;for 1..4;$,=~s;^.;;;$,});$;->setup;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 307 bytes
Desc: This is a digitally signed message part.
Url : http://lists.scsys.co.uk/pipermail/catalyst/attachments/20070704/aef40aa5/attachment.pgp


More information about the Catalyst mailing list