I need to apply some functions to a map of values. The functions are around 900 function in the worst case so i created them as records in a database and load them at once to a map.This way i may create an admin page to manage all the conversion formulas ... one day...
Now I have them like this
conversion=%{"0":"Tools.Myfunc1/1","1":"Tools.Myfunc2/1",etc...}
then I need to apply/execute them in a map statement.
The problem is that they are as strings and i get this error
|>Stream.zip(conversion)
|>Enum.map( fn {rawValue, formula} -> convertUsing(rawValue,formula) end)
expected a function, got "myModule.Myfunc/1"
def convertUsing(value,formula) do
{h,form}=formula
value
|>ieee
|>form.()
end
convertUsingyou are expecting an arity of 0 which means no arguments.