Slashdot Mirror


Ruby 2.3.0 Released (ruby-lang.org)

An anonymous reader writes: Ruby developers have announced the official release of Ruby 2.3.0. This release introduces a frozen string literal pragma, which is "a new magic comment and command line option to freeze all string literals in the source files." It also adds a safe navigation operator &. similar to what exists in C#, Groovy, and Swift. Ruby 2.3.0 also has many performance improvements. For more details, see the news file and the full changelog.

4 of 45 comments (clear)

  1. Re:A frozen string literal pragma by istartedi · · Score: 3, Informative

    If some twit has code like "hello"[5]=0 and you wonder why all your code is going to hell, maybe this will prevent it.

    --
    For all intensive purposes, "whom" is no longer a word. That begs the question, "who cares"?
  2. Re: Real rockstars use Erlang aka OTP by Billly+Gates · · Score: 2

    Outlaw Psycho Bitch is the shit man! You will have women watch you code at alternative coffee shops and groupies guaranteed!!

  3. Re:A frozen string literal pragma by HiThere · · Score: 2

    Frozen strings are extremely useful when doing multi-threaded code. I take this as a sign that Ruby is getting ready for actual use of multi-core execution. (Ruby has an equivalent to Python's GIL which currently prevents multiple simultaneous execution in the same interpeter/virtual machine.)

    --

    I think we've pushed this "anyone can grow up to be president" thing too far.
  4. Re:1st there was perl by Jane+Q.+Public · · Score: 2
    Ruby's syntax is actually considerably more consistent that Python's.

    You may be confused because Ruby has a plethora of alternate ways to do things. But they are not required and the underlying syntax is extremely consistent.

    The most inconsistent part of it was added to the language relatively recently. That is the "alternate" hash syntax. The standard syntax for a hash with symbols as keys is

    {:key1 => value1, :key2 => value2}

    and so on. But the alternate syntax is

    {key1: value1, key2: value2}

    much like JSON. I seldom use this alternate syntax precisely because while it can be simpler, it is inconsistent. Outside of the hash, you still have to use the standard notation :key1 and :key2for the symbols. So I prefer to put the colon at the beginning of all my symbols and maintain the original consistency.