Rebol 编程/函数
外观
< 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 ]