Loading Files¶
You can load source files into Idio with load
"file"
which will search IDIOLIB
for the actual file,
file.idio
. You should not use the filename extension with
load
.
load
is naïve and will blindly run everything in the file each
time you call it.
echo "this is dummy1"
load "dummy1"
load "dummy1"
$ idio simple-load
this is dummy1
this is dummy1
require / provide¶
require feature
is slightly smarter in that it will remember
when feature
has been successfully loaded and not
re-load the file if it has already done so.
To ensure that, the actually loaded source file,
feature.idio
must end with the expression: provide
feature
.
feature
is now a symbol rather than the string passed to
load
.
echo "this is dummy2"
provide dummy2
require dummy2
require dummy2
$ idio simple-require
this is dummy2
Last built at 2024-12-21T07:11:30Z+0000 from 77077af (dev) for Idio 0.3