On Mon Mar 09 12:58:50 2009, PERLER wrote:
Show quoted text> Ah I know why it stringifies. You use the node as hash key, which is
> always a string.
No, it's not as simple as that. _all_successors uses ye olde trick
"implement a set of objects as a hash with the stringified objects
as keys and the objects themselves as values". But it clobbers
the values in two places :(
Patch attached (fixes all_successors and all_predecessors).
I've also attached a simple test program.
Output showing the problem:
vertices: $VAR1 = [
\'e',
\'b',
\'d',
\'a',
\'c'
];
successors of SCALAR(0xf9d548): $VAR1 = [
\'b',
\'d'
];
all_successors of SCALAR(0xf9d548): $VAR1 = [
'SCALAR(0xf9d500)',
'SCALAR(0xf9d470)',
'SCALAR(0xf9d4a0)',
'SCALAR(0xf9d4d0)'
];
Correct would have been:
vertices: $VAR1 = [
\'e',
\'b',
\'d',
\'a',
\'c'
];
successors of SCALAR(0xfa2410): $VAR1 = [
\'b',
\'d'
];
all_successors of SCALAR(0xfa2410): $VAR1 = [
\'d',
\'c',
\'b',
\'e'
];