Support

If you have a problem or need to report a bug please email : support@dsprobotics.com

There are 3 sections to this support area:

DOWNLOADS: access to product manuals, support files and drivers

HELP & INFORMATION: tutorials and example files for learning or finding pre-made modules for your projects

USER FORUMS: meet with other users and exchange ideas, you can also get help and assistance here

NEW REGISTRATIONS - please contact us if you wish to register on the forum

Users are reminded of the forum rules they sign up to which prohibits any activity that violates any laws including posting material covered by copyright

If you're ever writing a parser in Ruby...

For general discussion related FlowStone

If you're ever writing a parser in Ruby...

Postby trogluddite » 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!
All schematics/modules I post are free for all to use - but a credit is always polite!
Don't stagnate, mutate to create!
User avatar
trogluddite
 
Posts: 1730
Joined: Fri Oct 22, 2010 12:46 am
Location: Yorkshire, UK

Re: If you're ever writing a parser in Ruby...

Postby tulamide » Sat Jan 04, 2020 6:01 pm

It's exactly that what I meant with careless integration on another "forum". The famous "@x" (a RubyEdit input named "x") is another example, internally reserved by DSPR without letting us know or protecting against us using it (luckily resolved in FS4!).

Should have taken you some time to realize it ;)
"There lies the dog buried" (German saying translated literally)
tulamide
 
Posts: 2714
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Re: If you're ever writing a parser in Ruby...

Postby trogluddite » Sat Jan 04, 2020 6:42 pm

I really ought to check out my old "Ruby hit-list" to see what's been fixed and what needs reporting. I've had a few crashes from bog-standard methods like .dup and .clone - the versions inherited from Object don't work so well (in 3.0.6) for some of the objects that wrap GDI+ pointers!

Mind you, I do get a rather perverse sense of enjoyment out of hacking my around them! :oops: :lol:
All schematics/modules I post are free for all to use - but a credit is always polite!
Don't stagnate, mutate to create!
User avatar
trogluddite
 
Posts: 1730
Joined: Fri Oct 22, 2010 12:46 am
Location: Yorkshire, UK


Return to General

Who is online

Users browsing this forum: No registered users and 84 guests