D-styled data file

Georg Wrede georg.wrede at iki.fi
Wed Apr 29 02:29:15 PDT 2009


Saaa wrote:
> I changed the prototype to:
> 
> void get(in char[] varName, ...)
> 
> I'm not totally happy with it because I only need one variadic argument and 
> :
> 
> How do I get the .stringof of an variadic type?
> _arguments[0].stringof doesn't work :)
> 
> How do I mutate the original argument? (ref)
> 
> Please tell me if I'm on the totally wrong track here.

What you're doing is called serialization.

I often find it good to get some background info. That often helps me 
rethink and maybe redefine the problem. It takes time to read stuff, but 
in the end it often saves even more time. Or effort. A couple of pointers:

http://en.wikipedia.org/wiki/Serialization_(computing)#Human-readable_serialization

Thinking about what your file might look like could also help:

http://en.wikipedia.org/wiki/JSON#Data_types.2C_syntax_and_example


More information about the Digitalmars-d-learn mailing list