If you're ever writing a parser in Ruby...
Posted: Sat Jan 04, 2020 2:12 pm
...don't call your parsing method "parse"!
It breaks the RubyEdit in a rather, erm... interesting way. After a bit of digging, I discovered that RubyEdits already have a method called "parse". It gets called every time you edit the code to, erm... parse the Ruby code into method definitions. So if you override it by defining your own, the RubyEdit no longer understands Ruby!
The usual convention is to use leading/trailing __underscores__ for "under the hood" Ruby methods which are likely to cause name collisions - but it seems DSPr like to keep us on our toes!
It breaks the RubyEdit in a rather, erm... interesting way. After a bit of digging, I discovered that RubyEdits already have a method called "parse". It gets called every time you edit the code to, erm... parse the Ruby code into method definitions. So if you override it by defining your own, the RubyEdit no longer understands Ruby!
The usual convention is to use leading/trailing __underscores__ for "under the hood" Ruby methods which are likely to cause name collisions - but it seems DSPr like to keep us on our toes!