Skip to content

Prettier Predicates

Latest
Compare
Choose a tag to compare
@gilbert gilbert released this 03 Aug 05:49
· 8 commits to master since this release

A quick fix to the DSL to support predicates with zero arity without the need for brackets. Example:

db = RubyProlog.new do
  tags['fire'].fact
  tags['paper'].fact

  # BEFORE:
  # is_lit[] << tags['fire']
  # AFTER:
  is_lit << tags['fire']
end

# BEFORE:
# db.query{ is_lit[] }  #=> [{}]
# AFTER:
db.query{ is_lit }  #=> [{}]