Rebol 程式設計/do-boot
外觀
DO-BOOT target args dependent
僅當值及其檔案(URL)及其依賴項存在時才執行值。
DO-BOOT 是一個函式值。
- 目標 -- (型別:任何)
- 引數 -- (型別:任何)
- 依賴項 -- (型別:任何)
do-boot: func [
{Does a value only if it and its file (URL) and it's dependent exists.}
target
args
dependent
/local check dir
][
check: func [target /local tmp] [
if exists? target [return make file! 1]
if exists? system/options/home/:target [return system/options/home]
none
]
if target [
if dependent [dir: check dependent]
if none? dir [dir: check target]
if dir [
dir: append copy dir target
if exists? dir [do/args dir args return true]
]
]
false
]