- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我发现在 Clojure 中,特殊形式不能作为参数传递或保存在变量中:
user=> (defn my-func
[op]
(op 1 2 3))
#'user/my-func
user=> (my-func +)
6
user=> (my-func if)
java.lang.Exception: Unable to resolve symbol: if in this context (NO_SOURCE_FILE:5)
user=> (def my-if if)
java.lang.Exception: Unable to resolve symbol: if in this context (NO_SOURCE_FILE:9)
在 Racket /计划中:
> (define (my-func op)
(op 1 2 3))
> (my-func +)
6
> (my-func if)
if: bad syntax in: if
> (define my-if if)
*if: bad syntax in: if
太好了,我对此很好,我知道我可以编写一个函数来包装一个特殊的形式,然后传递该函数。
但我想知道为什么 Lisp 有这个限制,以及允许这样做会产生什么负面后果。他们是否有任何允许这样做的主要方言?
最佳答案
它使评估更复杂,编译更难。
如果你有一个表单 (a b c)
,那么你需要在运行时解析 a
的值,然后以某种方式将它应用到表单 b
和 c
。
然后,一些有限数量的特殊形式和其他严格评估的更简单模型就消失了。
另请参阅:FEXPR
关于lisp - 允许将特殊形式视为正常值会产生什么后果?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11332601/
在编译iPhone应用程序时,有一个针对“优化”架构(仅限armv7)与标准armv6/armv7架构的设置。 编译纯armv7架构有什么好处/后果? 最佳答案 除非您的程序需要 OpenGLES 2
例如我有这段代码: Sub Month() Dim Conn As New Data.OracleClient.OracleConnection Conn.Open() Try
使用子域在 Wordpress 或 Blogger 上托管博客是否有任何 SEO 劣势?我不想为自己的站点创建博客模块而费心——我宁愿只设置一个 CNAME 条目并将子域指向一个免费的 Wordpre
我们使用免费 API 制作简单的 501C3 map 。通常我们的地理编码使用率很低,但我们所做的更改 [oops] 触发了所有 >2500 条记录的重新请求。 我们可以等待 24 小时“超时”。 我
我在 Heroku 上有一个 Web 应用程序,它一直使用大约 300% 的允许 RAM (512 MB)。我看到我的日志充满了错误 R14(超出内存配额)[每秒一个条目]。尽管状况不佳,我的应用程序
我在我的应用程序中以 FileChannel.MapMode.READ_WRITE 模式创建/使用内存映射文件。这些文件在应用程序的整个生命周期中创建和删除。 由于 GC 不一定释放直接缓冲区以_取消
增加最大连接数有什么害处?即使使用当前设置和复制设置,我们的主服务器也会提示已经有太多客户端。 在 postgresql.conf 中将最大连接数增加到 400 是否安全,或者我的服务器是否有问题,因
我正在处理的网站存在一些小问题,我想发布一个测试版本,在其中进行一些调整以查看效果(我想在移动设备上进行测试设备也是如此,因此拥有实时版本肯定是在多个设备上进行测试的最简单方法)。 理想情况下,我想要
我正在构建一个网站,其中导航栏的元素使用 HTML5 的 Canvas 元素进行动画处理。例如,按钮是 float 的圆圈。这个想法是按钮的文本将 float 到这些圆圈的右侧。我想知道,就 SEO
我是一名优秀的程序员,十分优秀!