gpt4 book ai didi

package - Common Lisp 包中的外部符号与内部符号

转载 作者:太空宇宙 更新时间:2023-11-03 18:44:13 24 4
gpt4 key购买 nike

它们在 Common Lisp 包的上下文中有什么区别?我正在阅读 SLIME 文档,一些命令广泛提到了这一点。

最佳答案

语法是什么?您导出的符号是外部的。

(in-package :cl-user)
(defpackage str
(:use :cl)
(:export
:trim-left
))

(in-package :str)

;; exported: can be accessed with `str:trim-left`.
(defun trim-left (s)
"Remove whitespaces at the beginning of s. "
(string-left-trim *whitespaces* s))

;; forgot to export: can still access it with `str::trim-right`.
(defun trim-right (s)
"Remove whitespaces at the end of s."
(string-right-trim *whitespaces* s))

关于package - Common Lisp 包中的外部符号与内部符号,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47782593/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com