[#101179] Spectre Mitigations — Amel <amel.smajic@...>
Hi there!
5 messages
2020/12/01
[#101694] Ruby 3.0.0 Released — "NARUSE, Yui" <naruse@...>
V2UgYXJlIHBsZWFzZWQgdG8gYW5ub3VuY2UgdGhlIHJlbGVhc2Ugb2YgUnVieSAzLjAuMC4gRnJv
4 messages
2020/12/25
[ruby-core:101496] [Ruby master Bug#17398] SyntaxError in endless method
From:
eregontp@...
Date:
2020-12-17 13:52:26 UTC
List:
ruby-core #101496
Issue #17398 has been updated by Eregon (Benoit Daloze).
Conceptually, according to the typical definition in computer science, both `puts("bar")` and `puts "bar"` are expressions (i.e., they return a value, and if it was some other method than `puts` it would also not always be `nil`).
It might be slightly less clear for e.g. `a = 42` (it's still an expression, it still returns a value), but I think `puts "bar"` is clear that it should be the same as `puts("bar")`, except for precedence.
So it's probably going to be very difficult to explain the actual condition, other than showing specific examples.
----------------------------------------
Bug #17398: SyntaxError in endless method
https://bugs.ruby-lang.org/issues/17398#change-89276
* Author: zverok (Victor Shepelev)
* Status: Open
* Priority: Normal
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN
----------------------------------------
This works:
```ruby
def foo() = puts("bar")
```
This does not:
```ruby
def foo() = puts "bar"
# ^ syntax error, unexpected string literal, expecting `do' or '{' or '('
```
Is this intentional or accidental? Not sure how it is reasoned.
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>