However, I found some old ruby code of mine (a pre-historic simple rule engine, using YAML as the syntax - called "ruby rules"), and strangely it made sense (and I swear I have no recollection of writing it):
- rule: FooSo what does this mean? I guess people smarter then me are right - ruby is a really friendly language. At least following the popular conventions for it leads to code that you could read well into the future (even without the comfort of static type guarantees).
set: Driver, Vehicle
if: driver.age < 21 and vehicle.high_performance
then: reject application
And a programmatic rule:
#now lets try it out
rule = Rule.new :declarations => ["a", "b"],
:types => [String.class, String.class],
:condition =>"a == '42' and b == '42'",
:action => "puts 'PASSED RULE 1'"
