by jond3k · 10y ago · 0 comments
To generate the first example in the readme:
import {solve} from 'logic'
function father(x,y) {
return x =='mcbob' && y == 'bob' ||
x =='bob' && y == 'bill';
}
solve(father) // a noop function used as a marker by babelMade a Babel transform real quick for this particular example:
import {solve} from 'logic'
solve((x,y) => x === "mcbob" && y === "bob" || x === "bob" && y === "bill");It should be more obvious what expressions are supported when it's validated by a Javascript parser. This is in contrast to the 'dynamic' approach which has no problem with the following until runtime:
and(gherkin(or()))