哪些版本的 LISP 有 putprop?

发布于 2024-10-26 07:33:02 字数 241 浏览 11 评论 0 原文

据称,我正在破解一个旧的 Lisp 程序,该程序曾经在 Franz LISP 中编译并运行。但 Franz LISP 太旧了,所以我正在尝试 CLISP 编译器。但是,CLISP 没有 putprop

我意识到我可以编写一个与 putprop 做同样事情的函数,但如果我必须执行进一步的翻译,我想知道:什么版本的 Lisp 确实有 putprop< /代码>?

I am hacking an old Lisp program, which once compiled and worked in Franz LISP, it is claimed. But Franz LISP is too old, so I am trying the CLISP compiler. However, CLISP does not have putprop.

I realise I could write a function that does the same thing as putprop, but in case I have to perform further translations, I am wondering: what version(s) of Lisp do have putprop?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

情场扛把子 2024-11-02 07:33:02

MACLISP 拥有它。 自从 据报道,Franz Lisp 与 MACLISP 类似,Kent Pitman 的 零 href="http://maclisp.info/pitmanual/cl-conv-01-intr.html" rel="nofollow">有关将 MACLISP/Zetalisp 转换为 Common Lisp 的注释 可以帮助您获取所需的代码正在努力在现代 Common Lisp 实现上运行。

祝你好运!

MACLISP had it. Since Franz Lisp is reportedly similar to MACLISP, there is a non-zerop chance that Kent Pitman's Notes on Converting MACLISP/Zetalisp to Common Lisp can help you in getting the code you're working with to run on a modern Common Lisp implementation.

Good luck!

所有深爱都是秘密 2024-11-02 07:33:02

Common Lisp 中通过 SETF 和 GET 的组合提供了等效功能。

CL-USER 1 > (setf (get 'foo :bar) :baz)
:BAZ

CL-USER 2 > (get 'foo :bar)
:BAZ

The equivalent functionality is provided in Common Lisp by a combination of SETF and GET.

CL-USER 1 > (setf (get 'foo :bar) :baz)
:BAZ

CL-USER 2 > (get 'foo :bar)
:BAZ
ぃ双果 2024-11-02 07:33:02

Portable Standard Lisp 也有它,Interlisp 也有。 Common Lisp 不这样做的原因可能是因为可恶的 SETF,您不应该用驳船触碰它,因为它会破坏性地修改数据结构。然而,其他遗留 Lisp 中的 putprop 也可能通过破坏性修改来工作,所以如果你想实现 putprop 你可以这样做:

(defmacro putprop (var prop val)
  `(setf (get ,var ,prop) ,val)) 

Portable Standard Lisp also has it, as does Interlisp. The reason Common Lisp doesn't is probably because of the execrable SETF, which you should not touch with a barge-pole, since it destructively modifies data structures. However, probably putprop in other legacy Lisps also work by destructive modification, so if you want to implement putprop you could do it:

(defmacro putprop (var prop val)
  `(setf (get ,var ,prop) ,val)) 
不乱于心 2024-11-02 07:33:02

我记得,Scheme 有 putprop;但你称其为 LISP 吗?


ACL2, http://en.wikipedia.org/wiki/ACL2, also has putprop, and it's built on Common Lisp.

as I remember, Scheme has putprop; but do you call that a LISP?


ACL2, http://en.wikipedia.org/wiki/ACL2, also has putprop, and it's built on Common Lisp.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文