Project

General

Profile

Actions

Bug #20965

closed

`it` vs `binding.local_variables`

Added by zverok (Victor Shepelev) about 17 hours ago. Updated about 3 hours ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 3.4.0dev (2024-12-15T13:36:38Z master 366fd9642f) +PRISM [x86_64-linux]
[ruby-core:120303]

Description

it is not available in the list of binding.local_varaibles, unlike numbered parameters:

p(proc { binding.local_variables }.call)  # []
p(proc { |x| binding.local_variables }.call)  # [:x]
p(proc { _1; binding.local_variables }.call)  # [:_1]
p(proc { vars = binding.local_variables; _1; vars }.call)  # [:_1, :vars]
p(proc { it; binding.local_variables }.call)  # []

I wonder if it is deliberate or accidental.


Related issues 1 (0 open1 closed)

Related to Ruby master - Feature #18980: `it` as a default block parameterClosedk0kubun (Takashi Kokubun)Actions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like2Like0Like0Like0