RE: pseudo-hashes? was: Data structure question

2001-01-23 Thread John Hughes
And indeed, they ought to die. Or be reimplemented. Or something, but quite simply, don't use them. They'll break, they won't dwim, and chances are they won't play nice with future/past versions of Perl. Forget they even exist. Details? I'm using them with no problems in 5.005_03 (the real

RE: pseudo-hashes? was: Data structure question

2001-01-23 Thread John Hughes
I had already reached the same conclusion after I saw that everyone would have to remember to say "my Dog $spot;" every time or the whole thing falls apart. Falls apart? How? If you want something reasonably close, you could do what a lot of the Template Toolkit code does and use arrays

RE: pseudo-hashes? was: Data structure question

2001-01-23 Thread Matt Sergeant
On Tue, 23 Jan 2001, John Hughes wrote: And indeed, they ought to die. Or be reimplemented. Or something, but quite simply, don't use them. They'll break, they won't dwim, and chances are they won't play nice with future/past versions of Perl. Forget they even exist. Details? I'm

RE: pseudo-hashes? was: Data structure question

2001-01-23 Thread Matt Sergeant
On Tue, 23 Jan 2001, John Hughes wrote: I had already reached the same conclusion after I saw that everyone would have to remember to say "my Dog $spot;" every time or the whole thing falls apart. Falls apart? How? Because you miss one out and its a very difficult to find bug in your

RE: pseudo-hashes? was: Data structure question

2001-01-23 Thread John Hughes
(exists doesn't work). Neither does delete. Ok. But what should it do? What does it do for an array? And overloading doesn't really work properly. Details? And reloading modules with phashes doesn't work right. I steer clear of reloading, almost anything screws up. And sub-hashes

RE: pseudo-hashes? was: Data structure question

2001-01-23 Thread Matt Sergeant
On Tue, 23 Jan 2001, John Hughes wrote: (exists doesn't work). Neither does delete. Ok. But what should it do? What does it do for an array? But we're talking about hashes! At the very least it should make it so that exists() returns false. And overloading doesn't really work

RE: pseudo-hashes? was: Data structure question

2001-01-23 Thread Robin Berjon
At 11:36 23/01/2001 +0100, John Hughes wrote: Neither does delete. Ok. But what should it do? What does it do for an array? perldoc -f delete "In the case of an array, if the array elements happen to be at the end, the size of the array will shrink to the highest element that tests true for

Re: pseudo-hashes? was: Data structure question

2001-01-23 Thread DeWitt Clinton
On Tue, Jan 23, 2001 at 10:06:13AM +, Matt Sergeant wrote: The only gain might be in a large DOM tree where there may be thousands of objects. But then you're really better off using an array based class instead (as I found out). This is getting a bit off-topic, but I'm empirically found

RE: pseudo-hashes? was: Data structure question

2001-01-23 Thread Matt Sergeant
On Tue, 23 Jan 2001, Robin Berjon wrote: At 11:36 23/01/2001 +0100, John Hughes wrote: Neither does delete. Ok. But what should it do? What does it do for an array? perldoc -f delete "In the case of an array, if the array elements happen to be at the end, the size of the array will

RE: pseudo-hashes? was: Data structure question

2001-01-23 Thread Robin Berjon
At 12:50 23/01/2001 +, Matt Sergeant wrote: Thats only 5.6+ though. So its only useful for internal applications (if at all). True, but we've been using 5.6 (built from AS source) in production for quite a while now very happily. Also, I'm seeing more and more customers having it or ready to

RE: pseudo-hashes? was: Data structure question

2001-01-23 Thread Perrin Harkins
On Tue, 23 Jan 2001, John Hughes wrote: I had already reached the same conclusion after I saw that everyone would have to remember to say "my Dog $spot;" every time or the whole thing falls apart. Falls apart? How? If you forget the "Dog" part somewhere, it's slower than a normal

pseudo-hashes? was: Data structure question

2001-01-22 Thread Tom_Roche
Until reading Conway's "Object Oriented Perl" http://www.manning.com/Conway/ (section 4.3, pp 126-135) I hadn't heard about pseudo-hashes. I now desire a data structure with non-numeric keys, definable iteration order, no autovivification, and happy syntax. (And, of course, fast-n-small :-)

Re: pseudo-hashes? was: Data structure question

2001-01-22 Thread Matt Sergeant
On Mon, 22 Jan 2001, [EMAIL PROTECTED] wrote: Well you've already seen I'm a detractor :-) * Is anyone now using (under mod_perl) something they consider to be superior but with similar functionality and interface? Yes, a class which is a blessed array. -- Matt/ /||** Director

Re: pseudo-hashes? was: Data structure question

2001-01-22 Thread Robin Berjon
At 18:05 22/01/2001 -0500, [EMAIL PROTECTED] wrote: the Perl6 RPC "Pseudo-hashes must die!" and And indeed, they ought to die. Or be reimplemented. Or something, but quite simply, don't use them. They'll break, they won't dwim, and chances are they won't play nice with future/past versions of

Re: pseudo-hashes? was: Data structure question

2001-01-22 Thread Perrin Harkins
On Mon, 22 Jan 2001 [EMAIL PROTECTED] wrote: (section 4.3, pp 126-135) I hadn't heard about pseudo-hashes. I now desire a data structure with non-numeric keys, definable iteration order, no autovivification, and happy syntax. (And, of course, fast-n-small :-) Having Conway's blessing is nice

Re: pseudo-hashes? was: Data structure question

2001-01-22 Thread Ken Williams
[EMAIL PROTECTED] (Perrin Harkins) wrote: On Mon, 22 Jan 2001 [EMAIL PROTECTED] wrote: (section 4.3, pp 126-135) I hadn't heard about pseudo-hashes. I now desire a data structure with non-numeric keys, definable iteration order, no autovivification, and happy syntax. (And, of course,