newLISP Fan Club

Forum => Anything else we might add? => Topic started by: cormullion on January 22, 2007, 12:25:34 AM

Title: getting the newLISP version number: (sys-info 6)
Post by: cormullion on January 22, 2007, 12:25:34 AM
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 ... :-)
Title:
Post by: HPW on January 22, 2007, 12:46:02 AM
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



;-)
Title:
Post by: cormullion on January 22, 2007, 01:22:26 AM
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)

Title:
Post by: cormullion on January 23, 2007, 11:01:25 PM
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)
Title:
Post by: Lutz on January 24, 2007, 02:43:36 PM
... and here is another solution:


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

=> "9.0.18"


Lutz