Skip to main content

software-type, software-version

software-type, software-version Function

Syntax:

software-type ⟨no arguments⟩ → description

software-version ⟨no arguments⟩ → description

Arguments and Values:

description—a string or nil.

Description:

software-type returns a string that identifies the generic name of any relevant supporting software, or nil if no appropriate or relevant result can be produced.

software-version returns a string that identifies the version of any relevant supporting software, or nil if no appropriate or relevant result can be produced.

Examples:

(software-type)"Multics" 
(software-version)"1.3x"

Affected By:

Operating system environment.

Notes:

This information should be of use to maintainers of the implementation.

user-homedir-pathname

Expanded Reference: software-type, software-version

Basic Usage

software-type returns a string identifying the operating system or generic software environment, while software-version returns a string identifying the version of that software. Both may return NIL if the information is unavailable.

(stringp (software-type))
;; => T

(or (stringp (software-version)) (null (software-version)))
;; => T

Typical Return Values Across Platforms

The returned strings are implementation-dependent and vary by both the Lisp implementation and the host operating system.

;; On SBCL running on Linux:  (software-type) => "Linux"
;; On SBCL running on macOS: (software-type) => "Darwin"
;; On SBCL running on Windows: (software-type) => "Win32"
;; (software-version) returns the kernel version string or NIL
(stringp (software-type))
;; => T

Building an Environment Description

These functions are commonly used with the machine-* family to produce comprehensive environment reports.

(defun environment-report ()
(format nil "~A ~A on ~A (~A ~A), Lisp: ~A ~A"
(or (software-type) "Unknown OS")
(or (software-version) "")
(or (machine-instance) "unknown host")
(or (machine-type) "?")
(or (machine-version) "")
(lisp-implementation-type)
(lisp-implementation-version)))

(stringp (environment-report))
;; => T

Important Notes

Both functions return a string or NIL. The format and content of the returned strings are entirely implementation-dependent. software-type typically identifies the operating system name, while software-version identifies the OS kernel or release version.