系统函数

Table of Contents

1. short-site-name

(short-site-name)

获得机器信息。不同的 Common Lisp 实现返回的信息不一致。

;; for CLISP,返回主机名
(short-site-name)                       ; => "lx"

;; for Allegro CL
(short-site-name)           ; => "LU4NX-PC"

;; for LispWorks
(short-site-name)                       ; => "Unknown"

;; for SBCL
(short-site-name)                       ; => NIL

2. long-site-name

(long-site-name)

获得机器信息。不同的 Common Lisp 实现返回的信息不一致。

;; for CLISP
(long-site-name) ; => "Linux mypc 4.3.5-300.fc23.x86_64 #1 SMP Mon Feb 1 03:18:41 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux"
;; for Allegro CL
(long-site-name)                        ; => "MYPC"
;; for LispWorks
(long-site-name)                        ; => "unknown"
;; for SBCL
(long-site-name)                        ; => NIL

3. machine-type

(machine-type)

获得处理器架构信息。

(machine-type)                          ; => "X86-64"

4. machine-version

(machine-version)

获得处理器信息。

(machine-version)      ; => "Intel(R) Core(TM) i7-3520M CPU @ 2.90GHz"

5. machine-instance

(machine-instance)

获得 Common Lisp 运行的平台信息,不同的实现返回的结果不一样,比如 SBCL 返回主机名:

(machine-instance)                      ; => "mypc"

6. software-type

(software-type)

返回操作系统平台信息,SBCL 输出:

(software-type)                         ; => "Linux"

7. software-version

(software-version)

返回平台的版本号,SBCL 输出:

(software-version)                      ; => "4.3.5-300.fc23.x86_64"