I'm not sure if this was brought before. Basically I've got lot's of fields in 
my custom type and would like to tweak the println function to include also the 
field name before printing each value. This tweak will tremendously help me 
with debugging my output.

For instance this simplified example gives the following output:

type myType
   myName::Int
   myValue::String
end

Dict(7=>myType(5,"CCC"),3=>myType(3,"BBB"),1=>myType(1,"AAA"))

And this line is the (non-existing custom prinln) output I'd like to get:

Dict(7=>myType(myName:5,myValue:"CCC"),3=>myType(myName:3,myValue:"BBB"),1=>myType(myName:1,myValue:"AAA"))


Before start looking in the details I'd like to find out if anybody had similar 
idea before? Perhaps this is not a new thing and something similar already 
exists in the form of a library?

The other question I have is how to make the custom print function generic 
enough?
I'd like to mimic the behavior of println this way so it has to work with any 
data type. At the moment it is not clear how println determines which fields of 
a type to output.

For instance for the Dict type which has these fields
:slots
:keys
:vals
:ndel
:count

How can we tell only keys and values are 'printable'?

Thank you

Reply via email to