General

Profile

seanlinsley (Sean Linsley)

  • Login: seanlinsley
  • Registered on: 04/17/2014
  • Last sign in: 03/15/2016

Issues

open closed Total
Assigned issues 0 0 0
Reported issues 2 0 2

Activity

03/15/2016

12:30 AM Ruby Bug #12073: local variable interferes with keyword arguments
This is also an issue with array destructuring:
```ruby
def a(*b)
b
end
a = [1,2,3]
a a
=> [[1, 2, 3]]
a *a
TypeError: no implicit conversion of Array into Integer
a(*a)
=> [1, 2, 3]
```
This is on Ruby 2.2.3.
seanlinsley (Sean Linsley)

02/24/2016

05:52 PM Ruby Feature #11816: Partial safe navigation operator
I prefer Marc's proposal here: https://bugs.ruby-lang.org/issues/11816#note-6. I think that's the much more natural than the existing behavior. I found this ticket after being surprised by the behavior, as I attempted to update my projec... seanlinsley (Sean Linsley)

08/10/2015

08:42 PM Ruby Feature #11429 (Open): Local variable assignment via regex ===
Currently, this assigns the `username` variable:
```ruby
/(?<username>.*)@.*\..*/ =~ "seanlinsley@example.com"
```
But this does not:
```ruby
/(?<username>.*)@.*\..*/ === "seanlinsley@example.com"
```
If it did, it would ...
seanlinsley (Sean Linsley)

05/08/2015

02:05 AM Ruby Feature #11129: block-level hash destructuring only works for the last argument
I'd rename this bug to something like "block-level hash destructuring only works for the last argument" if Redmine let you rename bugs... seanlinsley (Sean Linsley)
01:54 AM Ruby Feature #11129 (Open): block-level hash destructuring only works for the last argument
```ruby
[{a: 2}].each_with_index{ |a:, index| }
SyntaxError: unexpected tIDENTIFIER
[{a: 2}].each_with_index{ |(a:), index| }
SyntaxError: unexpected tLABEL
[{a: 2}].each_with_index.map{ |hash, index| [index, hash] }.map{ |index...
seanlinsley (Sean Linsley)

07/13/2014

11:05 PM Ruby Feature #8895: Destructuring Assignment for Hash
Koichi Sasada wrote:
> Problem is what happen when `h' is not a hash object (and doesn't have to_hash method).
> ...
I don't follow. Can't this assignment behave the same way that method argument destructuring does? This currently work...
seanlinsley (Sean Linsley)

04/17/2014

11:25 PM Ruby Feature #8895: Destructuring Assignment for Hash
This is what I'm imagining:
~~~ruby
a, *b, c:, d: 'd', **e = [1, {c: 2}]
a == 1
b == []
c == 2
d == 'd'
e == {} # holds any extras just like `b`
~~~
Where an error would be thrown if the hash didn't have the given key, and...
seanlinsley (Sean Linsley)

Also available in: Atom