Rebol 编程/func
外观
< Rebol 编程
FUNC spec body
使用给定的规范和主体定义用户函数。
FUNC 是一个函数值。
- spec -- 帮助字符串 (可选) 后跟参数词 (和可选类型和字符串) (类型:块)
- body -- 函数的主体块 (类型:块)
- 捕获
func: func [ "Defines a user function with given spec and body." [catch] spec [block!] {Help string (opt) followed by arg words (and opt type and string)} body [block!] "The body block of the function" ][ throw-on-error [make function! spec body] ]