跳轉到內容

Rebol 程式設計/does

來自華夏公益教科書,自由的教科書
DOES body 

一個定義沒有引數或區域性變數的函式的快捷方式。

DOES 是一個函式值。

  • body -- 函式的主體塊(型別:塊)

(特殊屬性)

[編輯 | 編輯原始碼]
  • 捕獲

原始碼

[編輯 | 編輯原始碼]
does: func [
    {A shortcut to define a function that has no arguments or locals.} 
    [catch] 
    body [block!] "The body block of the function"
][
    throw-on-error [make function! [] body]
]
華夏公益教科書