Rebol 程式設計/函式
外觀
FUNCTION spec vars body
定義具有區域性詞的使用者函式。
FUNCTION 是一個函式值。
- spec -- 可選的幫助資訊,後面跟著引數詞(以及可選的型別和字串)(型別:塊)
- vars -- 函式的區域性詞列表(型別:塊)
- body -- 函式的函式體塊(型別:塊)
function: func [
"Defines a user function with local words."
spec [block!] {Optional help info followed by arg words (and optional type and string)}
vars [block!] "List of words that are local to the function"
body [block!] "The body block of the function"
][
make function! head insert insert tail copy spec /local vars body
]