Re: [Templates] TT in callback

[prev] [thread] [next] [Date index for 2005/01/06]

From: Andy Wardley
Subject: Re: [Templates] TT in callback
Date: 11:08 on 06 Jan 2005
Perrin Harkins wrote:
> All I ask is that you name the fast non-localizing way that 99.9% of the
> world should be using "INCLUDE" and name the localizing way something
> else.  People constantly use the wrong one because of the names and
> don't even realize it.

Hi Perrin,

Yes, I agree that the difference between INCLUDE and PROCESS is confusing, 
and under TT2 the inefficiency of INCLUDE makes PROCESS the far better
choice if efficiency is an issue (although it's worth noting that for many 
TT users working offline, it isn't).

But under TT3 we can make the INCLUDE directive as fast as PROCESS currently
is in TT2 (give or take a bit), and still have it do the right thing with
respect to localising variables.

I would have thought that for most people, most of the time, the localising 
behaviour of INCLUDE was the more "correct" behaviour than PROCESS which 
effectively makes all variables global.  Perl subroutines keep parameters
and variables local by default, and Perl modules shouldn't export variables
or subroutines by default, so Perl templates should also "think globally,
but act locally" by default, by my way of thinking at least.

So I don't dispute what you're saying, but if we disregard the efficiency
concerns which we assume will be diminished in TT3, then my guess would be 
that perhaps 90% of the world should be using INCLUDE as it is, with its 
localising behaviour as it is, keeping PROCESS for those rarer occasions 
when they really do want variables and template BLOCKs defined in a template 
to be imported into the calling context.

I must admit it worries me slightly that I come down 90% in favour of one
approach and you're swung 99.9% the other way.  Assuming the efficiency 
problem goes away in TT3, is your position that non-localising is the 
correct behaviour by default, or rather that the name of the directive 
"INCLUDE" suggests that the template is processed inline and thus the 
user is expecting the variables to be imported, regardless of whether 
this is the more useful behaviour or not?

Cheers
A


_______________________________________________
templates mailing list
templates@xxxxxxxxxxxxxxxx.xxx
http://lists.template-toolkit.org/mailman/listinfo/templates

(message missing)

[Templates] TT in callback
Arshavir Grigorian 19:13 on 03 Jan 2005

Re: [Templates] TT in callback
Perrin Harkins 21:14 on 03 Jan 2005

Re: [Templates] TT in callback
Arshavir Grigorian 21:55 on 03 Jan 2005

Re: [Templates] TT in callback
Perrin Harkins 22:02 on 03 Jan 2005

Re: [Templates] TT in callback
Arshavir Grigorian 22:39 on 03 Jan 2005

Re: [Templates] TT in callback
Perrin Harkins 23:21 on 03 Jan 2005

Re: [Templates] TT in callback
Michael Peters 14:21 on 04 Jan 2005

Re: [Templates] TT in callback
Sean T Allen 14:46 on 04 Jan 2005

Re: [Templates] TT in callback
Perrin Harkins 15:48 on 04 Jan 2005

Re: [Templates] TT in callback
Andy Wardley 11:26 on 05 Jan 2005

Re: [Templates] TT in callback
Perrin Harkins 15:18 on 05 Jan 2005

Re: [Templates] TT in callback
Andy Wardley 11:08 on 06 Jan 2005

Re: [Templates] TT in callback
Perrin Harkins 19:34 on 06 Jan 2005

Re: [Templates] TT in callback
Harry Jackson 10:39 on 07 Jan 2005

Re: [Templates] TT in callback
Perrin Harkins 14:02 on 07 Jan 2005

Re: [Templates] TT in callback
Bill Moseley 16:11 on 07 Jan 2005

Re: [Templates] TT in callback
Perrin Harkins 16:23 on 07 Jan 2005

Re: [Templates] TT in callback
Bill Moseley 19:22 on 08 Jan 2005

Re: [Templates] TT in callback
C. Chad Wallace 18:05 on 07 Jan 2005

Re: [Templates] TT in callback
Tony Bowden 00:14 on 04 Jan 2005

Re: [Templates] TT in callback
Cees Hek 02:38 on 04 Jan 2005

Re: [Templates] TT in callback
merlyn (Randal L. Schwartz) 02:48 on 04 Jan 2005

Re: [Templates] TT in callback
Perrin Harkins 19:55 on 04 Jan 2005

Re: [Templates] TT in callback
Cees Hek 22:18 on 04 Jan 2005

Re: [Templates] TT in callback
Perrin Harkins 23:54 on 04 Jan 2005

Re: [Templates] TT in callback
Cees Hek 02:39 on 05 Jan 2005

Re: [Templates] TT in callback
Andy Wardley 10:59 on 05 Jan 2005

Re: [Templates] TT in callback
Perrin Harkins 19:40 on 04 Jan 2005

Re: [Templates] TT in callback
Arshavir Grigorian 22:16 on 07 Jan 2005

RE: [Templates] TT in callback
Jason Gottshall 22:29 on 05 Jan 2005

Re: [Templates] TT in callback
Mark Mills 22:46 on 05 Jan 2005

RE: [Templates] TT in callback
Simon Matthews 15:58 on 06 Jan 2005

RE: [Templates] TT in callback
Larry Leszczynski 19:44 on 06 Jan 2005

RE: [Templates] TT in callback
Simon Matthews 16:53 on 07 Jan 2005

RE: [Templates] TT in callback
Perrin Harkins 17:05 on 07 Jan 2005

Re: [Templates] TT in callback
Buddy Burden 23:52 on 07 Jan 2005

Re: [Templates] TT in callback
Perrin Harkins 05:18 on 05 Jan 2005

Re: [Templates] TT in callback
Cees Hek 05:48 on 05 Jan 2005

TT Caching (Was: Re: [Templates] TT in callback)
Larry Leszczynski 17:18 on 05 Jan 2005

Re: TT Caching (Was: Re: [Templates] TT in callback)
Perrin Harkins 18:07 on 05 Jan 2005

Re: TT Caching (Was: Re: [Templates] TT in callback)
Perrin Harkins 18:28 on 05 Jan 2005

Re: TT Caching (Was: Re: [Templates] TT in callback)
Larry Leszczynski 18:18 on 05 Jan 2005

Re: TT Caching (Was: Re: [Templates] TT in callback)
Perrin Harkins 19:15 on 05 Jan 2005

Re: TT Caching (Was: Re: [Templates] TT in callback)
Octavian Rasnita 19:00 on 05 Jan 2005

Re: TT Caching (Was: Re: [Templates] TT in callback)
merlyn (Randal L. Schwartz) 19:14 on 05 Jan 2005

Re: TT Caching (Was: Re: [Templates] TT in callback)
Octavian Rasnita 07:29 on 06 Jan 2005

Re: [Templates] TT in callback
Tony Bowden 15:05 on 06 Jan 2005

Re: [Templates] TT in callback
Andy Wardley 15:50 on 06 Jan 2005

Re: [Templates] TT in callback
Tony Bowden 09:09 on 07 Jan 2005

Re: TT Caching (Was: Re: [Templates] TT in callback)
Perrin Harkins 19:14 on 06 Jan 2005

Re: TT Caching (Was: Re: [Templates] TT in callback)
Octavian Rasnita 20:32 on 06 Jan 2005

Re: TT Caching (Was: Re: [Templates] TT in callback)
Perrin Harkins 21:14 on 06 Jan 2005

Re: [Templates] TT in callback
Perrin Harkins 19:44 on 08 Jan 2005

Re: [Templates] TT in callback
Bill Moseley 20:09 on 08 Jan 2005

Re: [Templates] TT in callback
Perrin Harkins 04:42 on 10 Jan 2005

Generated at 08:55 on 15 Mar 2005 by mariachi v0.52