What follows the keyword “case” there is a pattern, not an expression. It’s not an imperative construct of code to be executed, but a declarative construct of an expected shape of an object, which may include name bindings.
Consider things like “case DistanceMetric(distance=d):” earlier in the article: this checks “is the value an instance of DistanceMetric, and if so, take its distance attribute and bind it to the name d”.
So in this case, what would it mean? If the value is an instance of Not, take and bind it to the DistanceMetric name (as is typical for a single positional subpattern), and… uh oh, more parentheses, what to do? There’s no obvious sensible meaning for it, so it’s a syntax error.
Because the right arm of the 'case' keyword is not actually a statement being executed, but its own syntax element to represent a pattern. It is not expecting two sets of brackets there.
I'm going to emphasize this as well. Everything is an object, and everything called on an object is a method. Full stop.
Unlike with other languages, there is no ambiguity here.
In python, you don't know when you dir() an object whether your dealing with a property or method. In Ruby, you are guaranteed it's always a method. A perk is that you don't need parens.
Exactly. Once you get some basics of Ruby, there is no ambiguity, and I find it quite elegant.
And I think I’m in the minority here, but I prefer the cleanliness of optional punctuation.
That feature also allows for fluent DSLs (which seem to be falling out of favor for various reasons), but is one of the reasons I still love Ruby.
To look at the other side, I hate having to constantly add semicolons and parens in other languages. Makes my poor fingers hurt even more than they usually do.
I use the TP-Link TL-WR902AC for this, it's cheap and has a MAC cloning feature that makes it pretty easy. Unfortunately the firmware isn't updated anymore and it's missing a VPN client, but apart from that it gets the job done.
> What sort of vehicles will those deliverers and caregivers use?
The one they already have. How were they buying groceries and making deliveries before the pandemic? I understand where you are going with this, but that's not a good faith argument for keeping car factories open.
DoorDash is the worst. They inexplicably banned me from their platform after giving me a credit for a bad order. I filed several support tickets over several months and kept getting canned responses about how they were "looking into the issue." Eventually I just switched to Uber Eats.
I was an expecting an article about waterproofing differences between windows that open to the left and those that open to the right. Forgot this was HN.
You'd need the "crown" on the left of the watch body, in that case. Although it would be very nice of Google to add an option to flip the interface for users who want to wear the watch "upside-down".