Hi, I’m looking for guidance on better ways of accomplishing something. Im not exactly sure what “better” means in this instance; less brittle perhaps.
I currently have a CLI tool that accepts a filename as input, and the path to a “transformation.edn”.
The file is “processed”, by applying some transformations which are common to all files (and therefore embedded in the main program), and I have externalised transformations which aren’t common, and put them in “transformation.edn”
transformation.edn contains a hash, which is keyed from the name of a field to transform, and the value to a key is the function to apply to each row of the input file.
This works, but for some reason it just doesn’t feel right having functions defined and used like this. I’m looking for ideas or libraries that would make transformation.edn less code-like, and more configuration like, if that makes sense.
One alternative I thought about was to put the functions in a separate namespace and just reference them, but that approach seems less flexible.
Any ideas would be gratefully received.