havenwood changed the topic of #ruby to: Rules: https://ruby-community.com | Ruby 3.1.3, 3.0.5, 2.7.7, 3.2.0-rc1: https://www.ruby-lang.org | Paste 4+ lines to: https://gist.github.com | Books: https://goo.gl/wpGhoQ | Logs: https://libera.irclog.whitequark.org/ruby/
hansolo has quit [Ping timeout: 252 seconds]
hansolo has joined #ruby
moldorcoder7 has quit [Ping timeout: 252 seconds]
moldorcoder7 has joined #ruby
caedmon has quit [Ping timeout: 268 seconds]
caedmon has joined #ruby
caedmon has quit [Quit: caedmon]
RougeR has quit [Ping timeout: 272 seconds]
caedmon has joined #ruby
cryptkeeper has joined #ruby
cartdrige has joined #ruby
caedmon has quit [Ping timeout: 268 seconds]
crax23 has joined #ruby
cartdrige has quit [Ping timeout: 260 seconds]
ur5us__ has joined #ruby
ur5us_ has quit [Ping timeout: 252 seconds]
caedmon has joined #ruby
FullMetalStacker has joined #ruby
FullMetalStacker has quit [Client Quit]
caedmon has quit [Ping timeout: 268 seconds]
agent_white has joined #ruby
caedmon has joined #ruby
caedmon has quit [Client Quit]
caedmon has joined #ruby
desnudopenguino1 has joined #ruby
desnudopenguino has quit [Ping timeout: 252 seconds]
desnudopenguino1 is now known as desnudopenguino
ur5us__ has quit [Ping timeout: 256 seconds]
ur5us__ has joined #ruby
desnudopenguino1 has joined #ruby
desnudopenguino has quit [Ping timeout: 255 seconds]
desnudopenguino1 is now known as desnudopenguino
caedmon has quit [Ping timeout: 272 seconds]
stirl has quit [Ping timeout: 255 seconds]
m_antis has quit [Ping timeout: 260 seconds]
m_antis has joined #ruby
ur5us__ has quit [Ping timeout: 260 seconds]
Linux_Kerio has joined #ruby
TomyLobo has quit [Read error: Connection reset by peer]
polishdub has quit [Ping timeout: 260 seconds]
otisolsen70 has joined #ruby
otisolsen70 has quit [Remote host closed the connection]
otisolsen70 has joined #ruby
agent_white has quit [Quit: later]
ur5us__ has joined #ruby
reset has quit [Quit: reset]
ur5us__ has quit [Ping timeout: 246 seconds]
moldorcoder7 has quit [Ping timeout: 252 seconds]
teclator has joined #ruby
tomtmym has joined #ruby
tomtmym has quit [Changing host]
tomtmym has joined #ruby
Rounin has joined #ruby
Rounin has quit [Changing host]
Rounin has joined #ruby
willfish has joined #ruby
jvalleroy has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
jvalleroy has joined #ruby
ur5us__ has joined #ruby
Linux_Kerio has quit [Ping timeout: 260 seconds]
pip[m] has joined #ruby
pip[m] has left #ruby [#ruby]
ur5us__ has quit [Ping timeout: 246 seconds]
cryptkeeper has quit [Quit: Connection closed for inactivity]
cyj123 has quit [Quit: Connection closed for inactivity]
FullMetalStacker has joined #ruby
FullMetalStacker has quit [Remote host closed the connection]
FullMetalStacker has joined #ruby
FullMetalStacker has quit [Client Quit]
darkstardevx has quit [Read error: Connection reset by peer]
rvalue has quit [Read error: Connection reset by peer]
rvalue has joined #ruby
Sankalp has quit [Ping timeout: 268 seconds]
crax23 has quit [Ping timeout: 260 seconds]
Linux_Kerio has joined #ruby
weaksauce has quit [Ping timeout: 260 seconds]
Sankalp has joined #ruby
Sankalp has quit [Ping timeout: 252 seconds]
work has joined #ruby
weaksauce has joined #ruby
Sankalp has joined #ruby
graywolf has joined #ruby
moldorcoder7 has joined #ruby
budo has joined #ruby
crankharder has joined #ruby
polishdub has joined #ruby
<crankharder> what's the technical terms for this pattern: "if false ; my_var = 123 ; end ; my_var" and why does it not blow up with NameError ?
Pixi has joined #ruby
donofrio_ has quit [Remote host closed the connection]
Pixi__ has quit [Ping timeout: 252 seconds]
joto has quit [Ping timeout: 272 seconds]
desnudopenguino has quit [Ping timeout: 260 seconds]
desnudopenguino has joined #ruby
<havenwood> crankharder: An unused local variable is still set in the local table when the code is compiled to intermediary representation.
<havenwood> >> RubyVM::InstructionSequence.compile('meaning = 42 if false').to_a[4]
<ruby[bot]> havenwood: # => {:arg_size=>0, :local_size=>1, :stack_max=>1, :node_id=>4, :code_location=>[1, 0, 1, 21]} (https://carc.in/#/r/e9ox)
<havenwood> That one local variable gets set on the local table even though it's never assigned.
<havenwood> crankharder: It's not a pattern I'd follow, more of just a happenstance.
mollerup has quit [Remote host closed the connection]
mollerup has joined #ruby
desnudopenguino1 has joined #ruby
desnudopenguino has quit [Ping timeout: 255 seconds]
desnudopenguino1 is now known as desnudopenguino
budo has quit [Ping timeout: 272 seconds]
<crankharder> agree it's a weird pattern ; thanks for the explanation!
stirl has joined #ruby
<ox1eef_> In other words, all locals are assigned a value of nil at compile time.
agent_white has joined #ruby
Pixi has quit [Quit: Leaving]
Pixi has joined #ruby
graywolf has quit [Quit: WeeChat 3.5]
FullMetalStacker has joined #ruby
FullMetalStacker has quit [Client Quit]
havenwood has quit [Quit: The Lounge - https://thelounge.chat]
havenwood has joined #ruby
havenwood has quit [Client Quit]
havenwood has joined #ruby
_ht has joined #ruby
<adam12> crankharder: variable hoisting maybe?
<adam12> I'm not sure it's technically true but it is kind of similar.
<ox1eef_> Yeah, it is a bit similar but just lacks the block. if (foo) { var x = 1 } would hoist x to the nearest function in JS, but in Ruby if doesn't have a block.
willfish has quit [Ping timeout: 268 seconds]
<ox1eef_> The behavior of locals in Ruby is a bit surprising when you analyze it.
<ox1eef_> I guess the same could be said for instance variables, where you can reference them without them being defined. When you think about that, you might say it's a bad idea but in practice it's usually a good thing.
Milos has quit [Ping timeout: 252 seconds]
work has quit [Quit: Connection closed for inactivity]
Pixi has quit [Ping timeout: 268 seconds]
cartdrige has joined #ruby
Milos has joined #ruby
Pixi has joined #ruby
cryptkeeper has joined #ruby
caleb has quit []
caleb has joined #ruby
crax23 has joined #ruby
cartdrige has quit [Ping timeout: 252 seconds]
crax23 has quit [Ping timeout: 256 seconds]
crankharder has quit [Ping timeout: 272 seconds]
crankharder has joined #ruby
stirl has quit [Ping timeout: 246 seconds]
reset has joined #ruby
<adam12> ...
<adam12> This has to be an optimization.
<caleb> does jeremy hang out anywhere online to ask besides an issue?
<adam12> caleb: He used to be on IRC but with the split he moved on.
<adam12> weaksauce: Aha. Nice find.
ur5us__ has joined #ruby
jidar has quit [Remote host closed the connection]
<ox1eef_> caleb: The best way to get in touch is probably mailing lists / google groups.
<ox1eef_> Those, and IRC are my bread and butter.
Linux_Kerio has quit [Ping timeout: 272 seconds]
_ht has quit [Quit: _ht]
Aminda has quit [Remote host closed the connection]
Aminda has joined #ruby
otisolsen70 has quit [Quit: Leaving]
crankharder has quit [Ping timeout: 272 seconds]
sagax has quit [Ping timeout: 260 seconds]
agent_white has quit [Quit: bbl]
tomtmym has quit [Quit: Gone.]
cartdrige has joined #ruby
polishdub has quit [Ping timeout: 252 seconds]
polishdub has joined #ruby
ruby[bot] has quit [Remote host closed the connection]
ruby[bot] has joined #ruby
polishdub has quit [Remote host closed the connection]
teclator has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
phenom has quit [Ping timeout: 268 seconds]
phenom_ has joined #ruby
crankharder has joined #ruby
crankharder has quit [Ping timeout: 252 seconds]