News for hackers. Stuff that matters.
Re:Ruby 2.6 by _hardwaregeek on Monday December 24, 2018 @02:34PM (#18753837)
Damn, I should have remembered that. Especially considering I had a project where I had to trawl through the ruby parser including multiple assignment rules.
Re:Ruby 2.6 by mikekchar on Monday December 24, 2018 @03:06PM (#18753990)
To be fair, I find the destructuring syntax strange in Ruby. For example, why do I need the splat on the list? It doesn't make sense to me. I'm sure there is a good reason buried in the implementation, but if I were to design the syntax, I don't think I would do it that way.
Re:Ruby 2.6 by akira2501 on Monday December 24, 2018 @03:18PM (#18754062)
> For example, why do I need the splat on the list?

You don't on the RHS, or rather, it's redundant in the given example. On the LHS you need it to prevent single element capture.. and within the ruby language, it's a fairly consistent sigil.

Re:Ruby 2.6 by mikekchar on Monday December 24, 2018 @05:09PM (#18754547)
Wow. You're right. I'm not sure how I got that wrong. I'm sure I tried it. Thanks for correcting me!