【发布时间】:2021-04-22 06:27:36
【问题描述】:
>> f: func [x /a][either a [x + 2] [x + 1]]
== func [x /a][either a [x + 2] [x + 1]]
>> b: /a
== /a
>> f/b 1
*** Script Error: f has no refinement called b
*** Where: f
*** Stack: f
>> f/:b 1
*** Script Error: f has no refinement called :b
*** Where: f
*** Stack: f
可以看到函数f有一个refinement a,我把/a绑定到b。当通过b 调用f 及其精化/a 时,它会失败。
将需要先评估的细化传递给其函数的正确方法是什么?或者,有没有办法将path! 转换为function!?
【问题讨论】: