[stringtemplate-interest] render vs toString
Zenaan Harkness
zen at freedbms.net
Mon Oct 12 17:37:58 PDT 2009
On Mon, Oct 12, 2009 at 12:24:31PM -0700, Terence Parr wrote:
>
> On Oct 12, 2009, at 5:56 AM, Sam Harwell wrote:
>
> > The problem stems from ST violating the assumption in Java and C# that
> > toString/ToString are pure functions, i.e. ones with no visible side
>
> Yup. particularly for me they have side-effects when I try to track
> the execution.
>
> Wow. looks like we have consensus!
>
> Ok, i'll make it render() and see how it feels.
Ack! ++!
feels great already :)
>
> Ter
>
> > effects on program state. I think this can/needs to be solved in
> > either
> > of two ways: make toString pure or rename it to something like render.
> > Since changing the name to render is easier to ensure correct results,
> > that might be the better approach at this point.
> >
> > Sam
> >
> > -----Original Message-----
> > From: stringtemplate-interest-bounces at antlr.org
> > [mailto:stringtemplate-interest-bounces at antlr.org] On Behalf Of
> > Terence
> > Parr
> > Sent: Sunday, October 11, 2009 3:53 PM
> > To: stringtemplate-interest Template
> > Subject: [stringtemplate-interest] render vs toString
> >
> > 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()?
> > Ter
> > _______________________________________________
> > stringtemplate-interest mailing list
> > stringtemplate-interest at antlr.org
> > http://www.antlr.org/mailman/listinfo/stringtemplate-interest
>
> _______________________________________________
> stringtemplate-interest mailing list
> stringtemplate-interest at antlr.org
> http://www.antlr.org/mailman/listinfo/stringtemplate-interest
--
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