如何使用通用Lisp确定操作系统和主机名? [英] How can I determine the operating system and hostname using common lisp?

查看:58
本文介绍了如何使用通用Lisp确定操作系统和主机名?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

要使我的.sbclrc文件在我使用的两台计算机上工作,我想要一种从sbcl中获取主机名和/或操作系统的方法。我知道我可以设置然后寻找环境变量,但是还有更直接的方法吗?

To get my .sbclrc file working on the two computers I use, I'd like a way to get the hostname and/or operating system from within sbcl. I know I could set and then look for an environment variable, but is there a more direct approach?

更新

由于Ken的答案并非特定于sbcl,因此我将问题改为普通的lisp。

I changed the question to refer to common lisp, since the answer from Ken is not specific to sbcl.

推荐答案

我将使用 环境函数:

* (machine-instance)
"myhostname"
* (machine-type)
"X86-64"
* (machine-version)
"Intel(R) Core(TM)2 Quad CPU    Q6600  @ 2.40GHz"
* (software-type)
"Linux"
* (software-version)
"2.6.32-3-amd64"

这篇关于如何使用通用Lisp确定操作系统和主机名?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆