Hello Nick,

"BCS" <n...@anon.com> wrote in message
news:a6268ff137a98ccbd7270f72...@news.digitalmars.com...

pragma(ver, "1.23", "$") import foo.bar.baz; // imports foo.bar.baz,
require a version at or later than 1.23

I have a mixed opinion on that. On one hand, being able to specify
either a specific version or an arbitrary range matches real-world
cases much better than "any version" vs "this exact version". However,
different programs and libs use different versioning conventions. For
example: Are "v1.1" and "v1.100" the same or is the latter much newer?
Or, which is first, "v1.100" vs "v1.99"? Also, I can imagne certain
programs may be able to work with more complex ranges. For instace,
maybe FooApp can use BarLib's "v1.x" branch as long as it's at least
"v1.7", and it can also use any version of the "v2.x" branch from
"v2.1" through "v2.5", but "v2.4.3" through "v2.4.8" are known to have
problems.

Good, point. Dealing with that client side might be an issue. So how about do it server side? Define a way to map the given string (or strings) to something that can be handed off to the server and let the server do whatever it wants with it. The simplest one would be Nick's suggestion of allowing %VERSION% or the like in the mappings specifications.

OTOH how do you deal with sever libraries asking for different versions? The simplest option would be to allow the pragma to take a ordered list of preferences and have DMD try to find a common version.

--
... <IXOYE><



Reply via email to