Yes, I know you can do this with Perl and overloading, but in Ruby, this is built in to the language. First, here's some Prolog:
The to find out who is mortal:
? - mortal(WHO).
Someone has created a tiny Prolog in Ruby and to do the same query above, you do this:
mortal = Pred.new(:mortal)
mortal_goal = Goal.new(mortal, [:X])
man = Pred.new(:man)
man_goal = Goal.new(man, [:X])
query Goal.new(mortal, [:Y])
(Note: That took me a while to figure it out. Aside from dabbling, I've never really used Ruby before today. Now I'm trying to port a predicate logic engine. I'm not too bright.)
Of course, that's pretty painful. So they've redefined bits of Ruby (as they apply to their objects, so it's not global) and now they can issue the query like this:
mortal[:X] <<= man[:X]
That's pretty impressive. I wish Perl has symbols. Right now, I'm trying to fake it with an object, but it's not as easy.