Rebol 程式設計/func
外觀
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]
]