[Catalyst] Re: How to access current MyApp instance ?
Bill Moseley
moseley at hank.org
Sun Jul 1 21:54:38 GMT 2007
On Sun, Jul 01, 2007 at 09:27:17PM +0200, A. Pagaltzis wrote:
> * Bill Moseley <moseley at hank.org> [2007-07-01 19:25]:
> > Macro?
> >
> > [%
> > game_detail_link( Game, 'Click here' );
> > game_history_link( Game, 'View history' );
> > %]
>
> Avoid macros like the plague.
>
> ??? They share a namespace with variables.
Yes, right. References to subroutines are variables.
> ??? TT2 only has global variables with dynamic scoping.
Yes, you just have a stash, eh, hash. And shallow localization.
I kind of wish macros didn't bother with localization.
> ??? It???s extremely lenient at runtime; you can use function call
> syntax to ???invoke??? a variable, with no complaints.
Yes, that's the design. Or a byproduct of the design. You can invoke
variable syntax to invoke subroutine calls, too. [% foo %] just spits
out whatever foo is, and I don't worry about the implementation. Is
that good or bad? Either way, sure is handy.
> Taken together, these mean that you can have hours of fun chasing
> down stupid bugs.
Yes, when first using TT you can do that. It's not that bad with a
little experience. You can catch undefined errors automatically if
you want but TT ignoring them also works out to be a feature. TT
generates perl code, and when I have a tough problem I just debug that
code.
> 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.
Yes, we are celebrating 40 years this summer! Only when I'm really
tripping do I believe TT's a programming language.
> Have I mentioned that I hate TT2 with a passion?
Avoid it like the plague, then. ;)
--
Bill Moseley
moseley at hank.org
More information about the Catalyst
mailing list