OK, I’ve narrowed the problem down a little further.
I have this sstruct class which is like Struct or OpenStruct but with
some other features.
If you’re curious, see the rubyforge snippet:
http://rubyforge.org/snippet/detail.php?type=snippet&id=25
The point here is, it doesn’t quite work with pp for whatever reason.
Here’s an example showing how an ordinary Struct prettyprints, and
then a so-called SuperStruct for comparison.
This problem is likely related to the nontrivial metaprogramming I’m
doing in sstruct.
Ideas, anyone??
Hal
require 'pp’
require ‘sstruct’
Struct.new(“Bar”,:a,:b,:c,:d,:e,:f,:g,:h,:i)
y = Struct::Bar.new([1,2,3,4],“a string”,
{“a”=>“hash”,“of”=>“some kind.”},
File, nil, [[“an”,“array”],[“of”,“arrays”]],
“blah”, “blah”, “blah”)
pp y
···
Bam = SuperStruct.new(:a,:b,:c,:d,:e,:f,:g,:h,:i)
z = Bam.new([1,2,3,4],“a string”,{“a”=>“hash”,“of”=>“some kind.”},
File, nil, [[“an”,“array”],[“of”,“arrays”]],
“blah”, “blah”, “blah”)
pp z
Output:
#<Struct::Bar
a=[1, 2, 3, 4],
b=“a string”,
c={“of”=>“some kind.”, “a”=>“hash”},
d=File,
e=nil,
f=[[“an”, “array”], [“of”, “arrays”]],
g=“blah”,
h=“blah”,
i=“blah”>
<Bam: a=1234 b=a string c=ofsome kind.ahash d=File e=
f=anarrayofarrays g=blah h=blah i=blah>