Common Lisp重命名命名空间的方法

tjb*_*tjb 6 common-lisp

将命名空间重命名为其他东西的常见lisp方法是什么.所以不要写hunchentoot:start我可以写ht:start.

我正在寻找像pythons import A as B这样的东西.

编辑:使用接受的答案,为hunchentoot添加昵称的代码如下:

(rename-package :hunchentoot :hunchentoot '(:ht))
Run Code Online (Sandbox Code Playgroud)

Dou*_*rie 9

你称之为命名空间的是用它创建的Common Lisp包 defpackage

你想要包昵称 ht

执行defpackage对现有数据包具有实现定义的行为,但是一些实现允许添加昵称的方式.

还有一个功能rename-package可以重命名和添加昵称到包.

  • 以下是一个示例用法:http://stackoverflow.com/questions/12719039/which-regular-expression-libraries-should-i-use-in-common-lisp?answertab=votes#tab-top (2认同)