Re: R: [AD] Allegro 5 new config routines, alpha 1

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


Angelo Mottola wrote:
> That is purely for convenience: having an hex type different from a
> plain int helps in situations like for example when you convert an hex
> to string:

And there are some types of numbers that are by convention usually
written in hex (e.g., 24 bit color values encoded as an int are readable
as hex and not readable as decimal).

[snip]
> Prefixing/postfixing all variable names with a type identifier into
> the file isn't pretty, but may solve the issue. We could also make the
> config loading/saving routines to automatically add a comment next to
> each variable, specifying the type; 

I think the convention for config files is usually not to specify the
type. Can't we just save it as text in memory (without knowing the
type), and then anything can be read as an int (failing if it can't be
parsed as an int (i.e. either [0-9]* or 0x[a-f0-9]* or 0[0-7]*)), or as
a string or a float?

-- 
Sven Sandberg    svsa1977@xxxxxxxxxx    home.student.uu.se/svsa1977



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/