SPL function artifacts
SPL functions are defined in .spl files that are located within directories that correspond to namespaces.
For instance, the directory spl/helper might
contain a .spl file that defines an SPL function
that is named base64Encode
, which would be in the
namespace spl.helper
. Similar to composite operators,
SPL functions can be in nested directories and the same namespace
derivation rules from Primitive operator artifacts apply.
The namespace that is derived from the directory structure must match
the namespace that is defined in the .spl file.
For instance, define the base64Encode
as:
namespace spl.helper;
rstring base64Encode(rstring str) { ... }
If the namespace in the .spl file does not match the one derived from the directory structure, the toolkit indexing tool (spl-make-toolkit) issues an error.