newLISP Fan Club

Forum => Anything else we might add? => Topic started by: Dmi on March 26, 2006, 01:35:31 PM

Title: newLisp version function
Post by: Dmi on March 26, 2006, 01:35:31 PM
Is there a way to know the version currently running?

For programmatically displaying a string like:

"newLISP v.8.8.0-p2 on linux"
Title:
Post by: Sammo on March 26, 2006, 01:47:46 PM
Does the sys-info function help?



((sys-info) -2)

;-> 8802
Title:
Post by: Dmi on March 26, 2006, 02:37:50 PM
Thanks!

I haven't found it when has a look into sys-info :-
Title:
Post by: Sammo on March 26, 2006, 02:42:09 PM
Hello Dmi,



I'm glad that helped. Here's a function using sys-info that might also be helpful.
(define (newLisp-version)
  (let
    (
    OS '("unknown" "linux" "bsd" "osx" "solaris" "cygwin" "win32")
    FORMAT "newLisp v%s.%s.%s-p%s on %s"
    )
  ;body of let
    (apply format (flat (list FORMAT (explode (string ((sys-info) -2))) (OS ((sys-info) -1))))) ))
Title:
Post by: Dmi on March 27, 2006, 09:48:12 AM
Nice! I'm using it now!

The only point is that my 8.8.0-p2 returns "8800" as ((sys-info) -2)
Title:
Post by: pjot on March 27, 2006, 11:50:44 AM
There is a 'secret' number for Tru64Unix as well (9), maybe you want to add it also:



(set OS '("unknown" "linux" "bsd" "osx" "solaris" "cygwin" "win32" "" "" "Tru64Unix"))


Actually, the number 7 is used for the Win32 version compiled with Borland, and 8 is used for WindowsCE.



Peter
Title:
Post by: Dmi on March 27, 2006, 12:44:18 PM
Oke! DEC forever! :-)