Rebol 程式設計/reflect
外觀
REFLECT value field
返回有關值的定義相關詳細資訊。
REFLECT 是一個函式值。
- 值 -- (型別:任何型別)
- 欄位 -- 例如:spec body words values title 等。 (型別:詞語)
- 捕捉
reflect: func [
"Returns definition-related details about a value."
[catch]
value [any-type!]
field [word!] "Such as: spec body words values title etc."
][throw-on-error [
switch/default field [
spec [spec-of :value]
body [body-of :value]
words [words-of :value]
values [values-of :value]
types [types-of :value]
title [title-of :value]
] [
cause-error 'script 'invalid-arg field
]
]]