为什么将FEXPR丢弃在Common Lisp中? [英] Why were FEXPRs abandoned in Common Lisp?

查看:108
本文介绍了为什么将FEXPR丢弃在Common Lisp中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

许多LISP具有FEXPR,但它们未包含在CL中.
我读到这是因为FEXRP在静态分析中不能很好地工作.
有人可以解释吗?

Many LISPs had FEXPRs but they were not included in CL.
I read that this was because FEXRPs don't work well with static analysis.
Can someone explain this?

推荐答案

摘录自有关FEXPR的维基百科文章:

在1980年的Lisp和函数式编程会议上,Kent Pitman 提出了一篇论文"Lisp中的特殊形式",在其中他讨论了 宏和fexpr的优缺点,最终 谴责fexprs.他的主要反对意见是,在Lisp方言中 允许使用fexprs,静态分析通常无法确定是否 运算符代表一个普通函数或一个fexpr,因此, 静态分析无法确定操作数是否为 评估.特别是,编译器无法判断是否 可以安全地优化子表达式,因为子表达式可能 在运行时被视为未评估的数据.

At the 1980 Conference on Lisp and Functional Programming, Kent Pitman presented a paper "Special Forms in Lisp" in which he discussed the advantages and disadvantages of macros and fexprs, and ultimately condemned fexprs. His central objection was that, in a Lisp dialect that allows fexprs, static analysis cannot determine generally whether an operator represents an ordinary function or a fexpr — therefore, static analysis cannot determine whether or not the operands will be evaluated. In particular, the compiler cannot tell whether a subexpression can be safely optimized, since the subexpression might be treated as unevaluated data at run-time.

这篇关于为什么将FEXPR丢弃在Common Lisp中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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