And Mach will search this current directory - and also parent directories - for an extension file called foo.mach.edn. Once the extensions file is found Mach will load the extension targets. In the above example if foo.mach.edn contained:
bar #$ ["echo" "hello"]
Then the target 'bar' in the extension file will be aliased to 'tar' in the main Mach file. So running mach tar from the command line would echo hello.
Furthermore, any symbols in the target extension can be rewritten based on the supplied map of args. For example if the bar target was coded as such:
bar #$ ["echo" fido]
And bar was imported as such:
tar #import [foo/bar {fido "greetings"}]
then running mach tar from the command line would echo greetings.
Once it stabilises use the below as a basis.
Mach extension files
Currently you can add a target like this:
And Mach will search this current directory - and also parent directories - for an extension file called
foo.mach.edn
. Once the extensions file is found Mach will load the extension targets. In the above example if foo.mach.edn contained:Then the target 'bar' in the extension file will be aliased to 'tar' in the main Mach file. So running
mach tar
from the command line wouldecho hello
.Furthermore, any symbols in the target extension can be rewritten based on the supplied map of args. For example if the
bar
target was coded as such:And
bar
was imported as such:then running
mach tar
from the command line wouldecho greetings
.