ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:120303] [Ruby master Bug#20965] `it` vs `binding.local_variables`
@ 2024-12-18 19:58 zverok (Victor Shepelev) via ruby-core
  2024-12-19  0:41 ` [ruby-core:120308] " shan (Shannon Skipper) via ruby-core
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: zverok (Victor Shepelev) via ruby-core @ 2024-12-18 19:58 UTC (permalink / raw)
  To: ruby-core; +Cc: zverok (Victor Shepelev)

Issue #20965 has been reported by zverok (Victor Shepelev).

----------------------------------------
Bug #20965: `it` vs `binding.local_variables`
https://bugs.ruby-lang.org/issues/20965

* Author: zverok (Victor Shepelev)
* Status: Open
* Backport: 3.1: DONTNEED, 3.2: DONTNEED, 3.3: DONTNEED
----------------------------------------
`it` is not available in the list of `binding.local_varaibles`, **unlike** numbered parameters:

```ruby
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.



-- 
https://bugs.ruby-lang.org/
 ______________________________________________
 ruby-core mailing list -- ruby-core@ml.ruby-lang.org
 To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
 ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2025-01-20  9:50 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-12-18 19:58 [ruby-core:120303] [Ruby master Bug#20965] `it` vs `binding.local_variables` zverok (Victor Shepelev) via ruby-core
2024-12-19  0:41 ` [ruby-core:120308] " shan (Shannon Skipper) via ruby-core
2024-12-19  6:28 ` [ruby-core:120317] " nobu (Nobuyoshi Nakada) via ruby-core
2024-12-19  9:33 ` [ruby-core:120326] " tompng (tomoya ishida) via ruby-core
2024-12-23  3:37 ` [ruby-core:120369] " mame (Yusuke Endoh) via ruby-core
2024-12-23  4:55 ` [ruby-core:120372] " k0kubun (Takashi Kokubun) via ruby-core
2024-12-23  6:19 ` [ruby-core:120374] " zverok (Victor Shepelev) via ruby-core
2024-12-23  8:52 ` [ruby-core:120375] " mame (Yusuke Endoh) via ruby-core
2025-01-09 12:03 ` [ruby-core:120574] " mame (Yusuke Endoh) via ruby-core
2025-01-20  9:47 ` [ruby-core:120744] " mame (Yusuke Endoh) via ruby-core

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).