Rebol 编程/cd
外观
< Rebol 编程
CD 'path
更改目录(shell 快捷函数)。
CD 是一个函数值。
- path -- 接受 %file、:variables 和普通单词(作为目录)(类型:文件单词路径未设置字符串括号)
- catch
cd: func [
"Change directory (shell shortcut function)."
[catch]
'path [file! word! path! unset! string! paren!] "Accepts %file, :variables and just words (as dirs)"
][
if paren? get/any 'path [set/any 'path do path]
switch/default type?/word get/any 'path [
unset! [print what-dir]
file! [change-dir path]
string! [change-dir to-rebol-file path]
word! path! [change-dir to-file path]
] [throw-error 'script 'expect-arg reduce ['cd 'path type? get/any 'path]]
]