D Configuration Framework (alias Program Options)

Aarti_pl aarti at interia.pl
Wed Oct 10 00:53:04 PDT 2007


Bill Baxter pisze:
> Nice updates.  The example above doesn't work for me.  I get a runtime 
> error to the tune of
> """
> Error: AssertError Failure 
> f:/usr/pkg/d/dsss/bin\..\include\d\doost\core\Any.d(121) Error: type of 
> value (int) is different than requested (uint).
> """
> 
> 
> But it does seem to work if I change the define!(int) to define!(uint).
> 
> Also on the web page it said po[["compression"]].  But I went ahead and 
> fixed that since it's a wiki. :-) 
> [http://www.dsource.org/projects/doost/wiki/ProgramOptions]
> 
> I didn't fix the int/uint thing on the wiki page because it seems that's 
> maybe something you think should work?
> 
> --bb

Different types in definition and when getting value of option is a 
mistake - Any doesn't implement implicit conversions. But in fact when 
printing value of variable it is not necessary to use as!() template 
function. Any container has it's toString() method, so it is just enough 
to print value using:
writefln(po["compression"]);

It's a good lesson that every example should be compiled before posting :D

PS. Thanks to all for help with docs!

BR
Marcin Kuszczak
(aarti_pl)



More information about the Digitalmars-d-announce mailing list