metafacture / metafacture-fix

Work in progress towards an implementation of the Fix language for Metafacture
Apache License 2.0
6 stars 2 forks source link

Facilitate reusability (function libraries) #13

Open blackwinter opened 4 years ago

blackwinter commented 4 years ago
use(path_to_fix)
use(path_to_fix, as: namespace)
use(path_to_java)
TobiasNx commented 1 year ago

@blackwinter isn't this already solved with include, macro and your java support?

blackwinter commented 1 year ago

isn't this already solved with include, macro

Catmandu's use() statement works differently:

# this will look for fixes in the Foo::Bar namespace and make them
# available prefixed by fb
use(foo.bar, as: fb)
fb.baz()

# this will look for Foo::Bar::Condition::is_baz
if fb.is_baz()
   ...
   fix()
   ...
end

and your java support?

use(path_to_java) would probably be the correct way to make Java functions available. We're basically making everything on the class path available, just like in Metamorph.

TobiasNx commented 1 year ago
cmd(“java Myclass”)
>> send the record as JSON to the
STDIN of the external command and
replace it with the JSON from the
STDOUT

perlcode(“mycommand.pl”)
>> run the my command.pl on the data
in the record

is stated in the cheat sheet