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

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


> Wouldn't that be fairly easy, at least in principle?

Yes, it would be :)

> There is no real difference between bools and ints, so wether `1' is 
> integer or bool is IMHO not a very helpful distinction. 
> Something like 1234 is a normal integer, while "1234" and 
> "blabla" are 
> strings and 0x1234 is a hexadecimal number. Of course something like 
> blabla and blabla1234 could just be strings as well, but then 
> the meaning 
> of 1234blabla is rather ambiguous.

What worries me is that when you set a variable from a program as
belonging to hex for example, and you write the config to a file, when
you reload it next time, you probably want that variable to still be an
hex, without conversions. This is probably not really necessary, but it
would be nice, and I'd like to investigate in possible solutions...

> 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?

See my thought above; by using the (easy) solution you're proposing,
we'd loose informations on the types, which may not be good.

--
Angelo Mottola
a.mottola@xxxxxxxxxx
http://www.ecplusplus.com



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