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

Started by cormullion, January 22, 2007, 12:25:34 AM

Previous topic - Next topic

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

#1
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

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



(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

#3
This is better:


(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

#4
... and here is another solution:


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

=> "9.0.18"


Lutz