Re:Lisp in Your Language
by candeira on Wednesday September 09, 2015 @11:18PM
(#10196001)
I'm working on a data validation pipeline, and I recently noticed that the rules in my jury-rigged rule engine already look a bit like lisp, and briefly considered embedding a tiny scheme. That consideration lasted about a coffeetime.
My solution is going to be turning these rules into something that looks like Python, and feed each line to eval(). I reckon that will make 90% of the rule evaluation engine, which is my brittler code, to just disappear.
Sometimes the most obvious choice is also the best.
No, none of these rules are input by users. All of them come from our repo. We're safe and good.
My solution is going to be turning these rules into something that looks like Python, and feed each line to eval(). I reckon that will make 90% of the rule evaluation engine, which is my brittler code, to just disappear.
Sometimes the most obvious choice is also the best.
No, none of these rules are input by users. All of them come from our repo. We're safe and good.