【发布时间】:2014-06-11 23:36:32
【问题描述】:
我尝试在 REBOL 编程语言中将函数作为参数传递,但我还没有弄清楚正确的语法:
doSomething: func [a b] [
a b
a b
]
doSomething print "hello" {This should pass print as the first argument and "hello" as the second argument.}
这会产生错误,因为 print 函数被调用而不是被传递:
hello
*** ERROR
** Script error: doSomething does not allow unset! for its a argument
** Where: try do either either either -apply-
** Near: try load/all join %/users/try-REBOL/data/ system/script/args...
是否可以将print 函数作为参数传递而不是调用print 函数?
【问题讨论】:
标签: rebol