Getting whether it's Tango or Phobos

Sean Kelly sean at
Mon May 19 19:01:08 PDT 2008

Robert Fraser wrote:
> Bill Baxter wrote:
>> Robert Fraser wrote:
>>> Is there a reliable way to deduce whether the user is using Tango or 
>>> Phobos? I used to use:
>>> static if(is(typeof(object.toUtf8)))
>>> But since that got changed to toString that doesn't work right now. 
>>> For the time being, I can verify it's D1 and then use (with Tango 
>>> 0.99.6)
>>> static if(!is(typeof(string)))
>>> But I'm guessing Tango may be given a string type soon...?
>> version(Tango) { ... } else { ... }  ?
>> --bb
> That requires the user to specify -version=Tango . I'm looking for 
> something that can be compiled with either Tango or Phobos without 
> asking anything of the user.

Tango actually requires that version=Tango be set for the installation 
to be considered complete.  I suppose we could enforce this by adding a 
static failure condition to Tango's object.d file, but I'd like to think 
that making it a default part of the bundled Tango installs and 
documenting the requirement in our manual install docs would be sufficient.


More information about the Digitalmars-d-learn mailing list