Save-Point
Ruby the OOP language! - Printable Version

+- Save-Point (https://www.save-point.org)
+-- Forum: Games Development (https://www.save-point.org/forum-4.html)
+--- Forum: Development Discussion (https://www.save-point.org/forum-17.html)
+--- Thread: Ruby the OOP language! (/thread-7395.html)



Ruby the OOP language! - kyonides - 12-28-2018

It seems Ruby has given all rubyists a curious Christmas gift, it's Ruby version 2.6.0! It has been released two days ago and it comes with a few interesting changes and improved performance according to the official source. Shocked

Ruby Website

A small list of the new features that are discussed on the link above are:
  • Experimental implementation of JIT compiler.
  • Constant names may start with a non-ASCII capital letter.
  • Introduce endless ranges.
  • Speed up Proc#call and custom_block#call
  • Fiber.yield and Fiber#resume is about 5x faster on 64-bit Linux, but other systems also get some benefits.
Happy coding!? Very happy + Tongue sticking out


RE: Ruby the OOP language! - kyonides - 09-04-2020

Right Ward Assignment of Variables

Here you can take a look at an experimental feature that they might add to Ruby 2.8 alias version 3.0 that has not frozen its list of new features and improvements.
https://blog.saeloun.com/2020/08/31/ruby-adds-experimental-rightward-assignment.html

Here are two examples of how the code looks like right now till Ruby 2.7 and how it will be in 2.8.

Code:
first, second = [1, 2]
[1, 2] => first, second

The classic assignment looks fine but it is not natural according to the writer. The latter actually lets you read it the same way you would describe it to a friend that knows no Ruby at all.

As the article says, it might not be implemented if there's lack of interest or it looks lame. Even so take in consideration that there are other programming languages that already offer this features like R (for scientific databases?) and TI-BASIC.

So what do you think about it, guys? Happy with a sweat



RE: Ruby the OOP language! - DerVVulfman - 09-04-2020

TI-BASIC? That's just a plug to sell more calculators and force students to buy them.