On Tuesday, October 02, 2012 11:13:48 AM Tom Short wrote:
> Thanks, Stefan. Is there a less dangerous method? My use case is
> storing a type as an attribute string in an HDF5 file. Then, when the
> file is read into Julia, the reader can dispatch on the Julia type of
> an object. The reader needs to convert the string to a type.
My email to the list this morning anticipated this question a bit. A safer
alternative might be
typestring = get_type(fid, object)
read_function = read_dictionary[symbol(typestring))]
myobj = read_function(fid, object)
That's not using multiple dispatch, of course. But it would avoid the problem
where someone created an object whose typestring was "run(`rm ~/*`)".