Re: [Templates] Design question

[prev] [thread] [next] [Date index for 2004/06/29]

From: Buddy Burden
Subject: Re: [Templates] Design question
Date: 16:22 on 29 Jun 2004
Perrin,

> I actually have never heard of anyone doing that before.  A more common 
> approach is to simply implement the tied hash interface, like 
> Tie::IxHash does.  What you're doing sounds like overloading, not tie-ing.

Well, yes, overloading is exactly what it is.  I never meant to imply 
otherwise.  I don't believe there is any way to use tying to make one 
variable behave like both an array and a hash.

> FYI, the official way to do this now is with Hash::Util, which is part 
> of the core library.

Yes, I've seen that ... we only recently upgraded to 5.8, so I haven't 
gotten too deep into that yet.  I plan to investigate it to see if I can 
use that in my implementation instead, but I may not be able to, because 
while I don't want to allow changes to they keys _casually_ (i.e., via 
autovivification), I do have to have be able to do it when called for.

But I fear we may have drifted from the original topic, and I don't want 
to get too far off, given that this is a mailing list for TT2. 
Basically, the situation is that I have an object, which has three years 
worth of code built around it.  It works, and it works well.  I don't 
want to replace it, and, while I may want to change the internal 
implementation at some point, that doesn't really enter into the 
discussion at hand.  I can, however, rather trivially extend it to add 
new functionality that doesn't impact existing code.

Given all that, is the best way to make this work with TT2 to extend it 
until it reaches full emulation of a hash inside TT2? or is there a 
better, simpler way?  That's the real question I'm trying to get at.


		-- Buddy

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

(message missing)

[Templates] Design question
Buddy Burden 18:58 on 28 Jun 2004

Re: [Templates] Design question
Jeff Anderson 19:16 on 28 Jun 2004

Re: [Templates] Design question
Mark Mills 19:16 on 28 Jun 2004

Re: [Templates] Design question
Buddy Burden 20:20 on 28 Jun 2004

RE: [Templates] Design question
Bruce McKenzie 20:46 on 28 Jun 2004

Re: [Templates] Design question
Ken.Olstad 20:55 on 28 Jun 2004

Re: [Templates] Design question
Perrin Harkins 21:25 on 28 Jun 2004

Re: [Templates] Design question
Jeff Anderson 21:47 on 28 Jun 2004

Re: [Templates] Design question
Buddy Burden 16:11 on 01 Jul 2004

Re: [Templates] Design question
Jeff Anderson 18:05 on 01 Jul 2004

Re: [Templates] Design question
Buddy Burden 22:33 on 28 Jun 2004

Re: [Templates] Design question
Perrin Harkins 22:52 on 28 Jun 2004

Re: [Templates] Design question
Buddy Burden 23:18 on 28 Jun 2004

Re: [Templates] Design question
Perrin Harkins 03:21 on 29 Jun 2004

Re: [Templates] Design question
Buddy Burden 16:22 on 29 Jun 2004

Re: [Templates] Design question
Mark Mills 17:09 on 29 Jun 2004

Re: [Templates] Design question
Buddy Burden 17:47 on 29 Jun 2004

[Templates] Design question
Chris Ochs 06:53 on 08 Dec 2004

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