跳转到内容

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
]
华夏公益教科书