newLisp version function

For the Compleat Fan
Locked
Dmi
Posts: 408
Joined: Sat Jun 04, 2005 4:16 pm
Location: Russia
Contact:

newLisp version function

Post by Dmi »

Is there a way to know the version currently running?
For programmatically displaying a string like:
"newLISP v.8.8.0-p2 on linux"
WBR, Dmi

Sammo
Posts: 180
Joined: Sat Dec 06, 2003 6:11 pm
Location: Loveland, Colorado USA

Post by Sammo »

Does the sys-info function help?

((sys-info) -2)
;-> 8802

Dmi
Posts: 408
Joined: Sat Jun 04, 2005 4:16 pm
Location: Russia
Contact:

Post by Dmi »

Thanks!
I haven't found it when has a look into sys-info :-\
WBR, Dmi

Sammo
Posts: 180
Joined: Sat Dec 06, 2003 6:11 pm
Location: Loveland, Colorado USA

Post by Sammo »

Hello Dmi,

I'm glad that helped. Here's a function using sys-info that might also be helpful.

Code: Select all

(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))))) ))

Dmi
Posts: 408
Joined: Sat Jun 04, 2005 4:16 pm
Location: Russia
Contact:

Post by Dmi »

Nice! I'm using it now!
The only point is that my 8.8.0-p2 returns "8800" as ((sys-info) -2)
WBR, Dmi

pjot
Posts: 733
Joined: Thu Feb 26, 2004 10:19 pm
Location: The Hague, The Netherlands
Contact:

Post by pjot »

There is a 'secret' number for Tru64Unix as well (9), maybe you want to add it also:

Code: Select all

(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

Dmi
Posts: 408
Joined: Sat Jun 04, 2005 4:16 pm
Location: Russia
Contact:

Post by Dmi »

Oke! DEC forever! :-)
WBR, Dmi

Locked