getting the newLISP version number: (sys-info 6)

For the Compleat Fan
Locked
cormullion
Posts: 2038
Joined: Tue Nov 29, 2005 8:28 pm
Location: latiitude 50N longitude 3W
Contact:

getting the newLISP version number: (sys-info 6)

Post by cormullion »

I'm just working out how to get the newLISP version number.

How does (sys-info 6) work? Are there always 4 digits, and is the point release always two digits? What happens when version 10 comes?

At present, it returns 9015, which is quite easy to resolve to 9.0.15. What did it say for 9.0.9 - 909 or 9009? How do you tell the difference between 9.11.0 and 9.1.10?

The manual retains a dignified silence on these vital issues ... :-)

HPW
Posts: 1390
Joined: Thu Sep 26, 2002 9:15 am
Location: Germany
Contact:

Post by HPW »

9.0.0 is 9000 so I would expect 9.0.9 to be 9009

I think Lutz use only one digit for point-releases and make not more than 99 development releases.

I would expect than 10.0.0 to be 10000

;-)
Hans-Peter

cormullion
Posts: 2038
Joined: Tue Nov 29, 2005 8:28 pm
Location: latiitude 50N longitude 3W
Contact:

Post by cormullion »

Ah! Thanks - so you reckon this might do the trick for the next few versions:

Code: Select all

(set 'version-string (string (sys-info 6)))

(set 'dev-version (pop version-string -2))    ; last two digits
(set 'point-version (pop version-string -1))  ; one digit
(set 'version version-string)                 ; what's left

(println version "." point-version "." dev-version)


cormullion
Posts: 2038
Joined: Tue Nov 29, 2005 8:28 pm
Location: latiitude 50N longitude 3W
Contact:

Post by cormullion »

This is better:

Code: Select all

(set 'version-string (string (sys-info 6))) 

(set 'dev-version (pop version-string -2 2))  ; last two digits 
(set 'point-version (pop version-string -1))  ; one digit 
(set 'version version-string)                 ; what's left 

(println version "." point-version "." dev-version) 

Lutz
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

... and here is another solution:

Code: Select all

(let (v (string (sys-info 6))) 
    (append (chop v 3) "." (v 1) "." (-2 v)))

=> "9.0.18"
Lutz

Locked