跳轉到內容

Rebol 程式設計/what

來自華夏公益教科書,開放的書籍,為了開放的世界
WHAT 

列印全域性定義函式的列表。

WHAT 是一個函式值。

原始碼

[編輯 | 編輯原始碼]
what: func [
    "Prints a list of globally-defined functions." 
    /local vals args here total
][
    total: copy [] 
    vals: second system/words 
    foreach word first system/words [
        if any-function? first vals [
            args: first first vals 
            if here: find args /local [args: copy/part args here] 
            append total reduce [word mold args]
        ] 
        vals: next vals
    ] 
    foreach [word args] sort/skip total 2 [print [word args]] 
    exit
]
華夏公益教科書