[Issue 2370] Version statement enhancement: versioned identifiers

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Oct 15 07:57:57 PDT 2008


http://d.puremagic.com/issues/show_bug.cgi?id=2370





------- Comment #12 from brunodomedeiros+bugz at gmail.com  2008-10-15 09:57 -------
(In reply to comment #7)
> (In reply to comment #6)
> > If you add a specific feature in a given version, it's best (clearer) to add a:
> >   version = NiftyMyLibCallAvailable;
> > and then use:
> >   version(NiftyMyLibCallAvailable)
> >   {
> >     NiftyMyLibCall();
> >   }
> > instead of version numbers.
> Is there *any* library around that has a version/#define for every single
> interface and every single change in that interface?  I don't think so, it's
> just not feasible.

I've seen the equivalent, in Java. Namely in Eclipse, where the API is managed
through the use of interfaces. Whenever new functionality is added, they don't
changed the existing interface, but add a new one, with a name like
IFooExtension4 Example:
http://help.eclipse.org/stable/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/api/org/eclipse/jface/text/ITextViewerExtension7.html
There are dozens of interfaces like that. (although few reach as many as a 7th
version)

(In reply to comment #8)
> Several of the comments seem to be forgetting that "version = bob" in an
> imported file has no effect on "version(bob)" statements in the importing file.

Dang, forgot about that indeed.

(In reply to comment #9)
> (In reply to comment #8)
> > Several of the comments seem to be forgetting that "version = bob" in an
> > imported file has no effect on "version(bob)" statements in the importing file.
> You're right.  This is a very strange and undocumented behavior.  Well, this
> adds more value to my proposal: writing 21 version statements in command line
> is... well, tedious.

If you use a proper build tool, editor, or IDE (which you obviously should),
you should only have to write these statements *once*, which hardly counts as
tedious or even significant.


-- 



More information about the Digitalmars-d-bugs mailing list