4.12 Loading Files
TBoS p.44
The function load loads a file containing a Shen program using the pathname as a string. All files are opened
relative to the value for the home directory. The value of this global is changed by the cd function.
(0-) (load "factorial.shen")
(fn factorial)
loaded
(1-) (factorial 3)
6
(2-) (cd "My Workspace")
"My workspace/"
(3 -) (load "factorial.shen")
OPEN: File "My Workspace/factorial.shen" does not exist
(3-) (cd "") \\ resets the home directory to default
""
(4-) (load "factorial.shen")
(fn factorial)
loaded |
|