Re: Random musings on a way to organize your modules.

Jack Jansen (jack@cwi.nl)
Tue, 5 Apr 1994 11:16:43 GMT

philip@cs.vu.nl (Philip Homburg) writes:

>In article <CnJsnv.KnF@cwi.nl> jack@cwi.nl (Jack Jansen) writes:
>%One thing that has been nagging me for a long time is how we are going
>%to keep different versions of modules apart [...]

>What about a system or scheme where officially exported interfaces
>have time stamps? I.e. my vapor-ware interface to Fresco would get time stamp
>765224083 (the current UNIX time in seconds since 1970)

This could be part of the solution. There is another bit needed,
though, that says which interfaces the current version of the module
is compatible with. So, maybe something like

# Module foobie, third version
_VERSION=765224083
_COMPATIBLE=[765134022, 765204562, 765224083]

could do the trick, since you could import with
import foobie
if not 765224083 in foobie._COMPATIBLE:
print 'Possible version-conflict for module foobie'

I'm not sure that unreadable integers are really needed, though, the
version "numbers" could as easily be strings, as in
_VERSION='2.1 jack@cwi.nl'

The *real* problem, however, is that you would like some automatic
support for something like this. This should take the form of (a) an
easy way to change version numbers, preferrably a script that you
would run on a set of modules before you export them to the world at
large, and (b) a script that will run through all your python sources
and warn you of possible incompatabilities.
(Actually, the *real* *real* problem is not coming up with the scheme,
but getting everyone to use it. I think I'll go nag Guido again, when
he's back).

-- 
--
Jack Jansen        | If I can't dance I don't want to be part of
Jack.Jansen@cwi.nl | your revolution             -- Emma Goldman
uunet!cwi.nl!jack    G=Jack;S=Jansen;O=cwi;PRMD=surf;ADMD=400net;C=nl