General

Profile

ndn (Nikola Nenkov)

  • Login: ndn
  • Registered on: 10/13/2016
  • Last sign in: 03/27/2017

Issues

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

Activity

06/09/2017

07:37 AM Ruby Feature #13645 (Open): Syntactic sugar for indexing when using the safe navigation operator
# Proposal
While it works and makes sense, this is a bit cumbersome:
```ruby
hash&.[](:key)
```
Ideally, we could use something like:
```ruby
hash&.[:key]
```
ndn (Nikola Nenkov)

03/27/2017

01:38 PM Ruby Bug #13371: Syntax Error with regex when parens are omitted
shyouhei (Shyouhei Urabe) wrote:
> ndn (Nikola Nenkov) wrote:
> ...
Yes, but it was more of a question if it's a bug or not. Like should I use `%r//` when omitting parens as a principle? If yes - I would submit a PR in Rubocop and so on.
ndn (Nikola Nenkov)
01:20 PM Ruby Bug #13371 (Rejected): Syntax Error with regex when parens are omitted
When you skip the parens of method invocations and pass a regex, you can get a `SyntaxError` if the regex starts with a space.
~~~ ruby
''.split(/ ./) # => []
''.split /./ # => []
''.split / ./ # !> SyntaxError: unexpected '.'
...
ndn (Nikola Nenkov)

10/13/2016

03:42 PM Ruby Bug #12834: `prepend` getting prepended even if it already exists in the ancestors chain
My point was that whether or not a module will get prepended can have an actual impact, yet it got changed between versions without an explicit notice. Given that the behaviour is documented as opposed to left undefined, I thought that t... ndn (Nikola Nenkov)
10:48 AM Ruby Bug #12834 (Closed): `prepend` getting prepended even if it already exists in the ancestors chain
```
module M; end
class A; prepend M; end
class B < A; prepend M; end
B.ancestors # => [M, B, M, A, Object, Kernel, BasicObject]
```
Even though I find this behaviour to be more intuitive, it is inconsistent with `Module#includ...
ndn (Nikola Nenkov)

Also available in: Atom