API Evolution

Chad J gamerchad at __spam.is.bad__gmail.com
Wed Feb 11 07:53:00 PST 2009


Daniel Keep wrote:
> bearophile wrote:
>> This is a bit related to the discussion about version().
>>
>> In the Lambda the Ultimate blog-forum they are discussing about better support in languages for API Evolution:
>>
>> http://lambda-the-ultimate.org/node/2950
>>
>> In the discussion someone has said that it may be useful a syntax to specify what version of a module/package must be imported. (And now and then I have seen people in Python mailing lists ask for something similar, they have several versions of the same module/package and they want other modules to import only the right version).
>>
>> [snip]
>>
>> Bye,
>> bearophile
> 
> Couldn't you just compile with a specific version?  I don't see a reason
> for the language to support this when D currently doesn't even have the
> concept of libraries.
> 
> If anything, this should be a candidate feature for DSSS.  Maybe you
> could do it like so:
> 
> version( build )
> {
>     // Obviously, you'd only use ONE of these...
>     pragma( library_version, derelict.gl, "1.3.*" );
>     pragma( library_version, derelict.gl, "1.3.*", "1.4.*" );
>     pragma( library_version, derelict.gl, "1.3+" );
> }
> 
> import derelict.gl;
> 
> DSSS could then download and install the appropriate version if it isn't
> already present.
> 
>   -- Daniel

This kind of thing would be awesome, whether it be by language builtins
or by DSSS.  It's also the kind of thing I might just get frustrated and
write at some point.  DSSS needs to act a bit more like portage ;)



More information about the Digitalmars-d mailing list