Toxic Elephant

Don't bury it in your back yard!

In Ruby, negation is a method

Posted by matijs 30/01/2014 at 06h16

These past few days, I’ve been busy updating RipperRubyParser to make it compatible with RubyParser 3. This morning, I discovered that one thing that was changed from RubyParser 2 is the parsing of negations.

Before, !foo was parsed like this:

s(:not, s(:call, nil, :foo))

Now, !foo is parsed like this:

s(:call, s(:call, nil, :foo), :!)

That looks a lot like a method call. Could it be that in fact, it is a method call? Let’s see.

Tags , no comments no trackbacks

Things: A classification

Posted by matijs 19/01/2014 at 11h33

  • Things needed every day
  • Things needed every week
  • Things needed only during a certain season
  • Things needed for administrative purposes
  • Things kept for sentimental reasons
  • Thinks kept for beauty

Tags no comments no trackbacks