[stringtemplate-interest] render vs toString

Zenaan Harkness zen at freedbms.net
Sun Oct 11 16:10:52 PDT 2009


On Sun, Oct 11, 2009 at 01:52:59PM -0700, Terence Parr wrote:
> heh, it's pretty hard to debug ST when the debugger calls toString all  
> the time on the templates. Using render makes much more sense.  But,  
> from a user perspective do you folks also run into trouble because of  
> this or is it only debugging ST itself that is troubled by toString()?

Never been a problem for me, an ST user.

When I'm debugging, I'm mostly debugging templates - I use a simple
driver model, so not a lot of code to handle, but plenty of templates.

Sor example, this causes difficulty when I use template debugging mode
(outputting angle backets for example), since this causes my template
conditionals to not work properly (there's always some strings output -
the angle brackets and template names - so conditional is never empty);
I think what might be useful here is a way to separate those "template
debugging outputs" from my "usual expected" outputs. Perhaps stdout and
stderr, except you'd probably need a .sync/ .flush after each element is
output, so that the streams 'merge' properly, so that on the screen
(stdout + stderr), you the output which includes debugging output, but
in my output file and within the template processing proper (just
stdout) normal ST output would appear. All that disk/ stream syncing
would slow things down, but we're in debugging mode, so that's
expected...

Make sense?


-- 
Homepage: www.SoulSound.net -- Free Australia: www.UPMART.org
Please respect the confidentiality of this email as sensibly warranted.


More information about the stringtemplate-interest mailing list