havenwood changed the topic of #ruby to: Ruby 3.2.2, 3.1.4, 3.3.0-preview2: https://www.ruby-lang.org | Rules: https://ruby-community.com | Logs: https://libera.irclog.whitequark.org/ruby
goldfish has quit [Ping timeout: 240 seconds]
TikTokTikTok has joined #ruby
TikTokTikTok has quit [Remote host closed the connection]
caedmon has joined #ruby
caedmon has quit [Ping timeout: 255 seconds]
Condition_Boy has joined #ruby
ConditionBoy has quit [Ping timeout: 255 seconds]
Condition_Boy has quit [Read error: Connection reset by peer]
ConditionBoy has joined #ruby
caedmon has joined #ruby
caedmon has quit [Ping timeout: 255 seconds]
hightower3 has joined #ruby
hightower2 has quit [Ping timeout: 255 seconds]
caedmon has joined #ruby
caedmon has quit [Read error: Connection reset by peer]
caedmon has joined #ruby
_ht has joined #ruby
Aminda has quit [Remote host closed the connection]
blop_ has quit [Remote host closed the connection]
Aminda has joined #ruby
blop_ has joined #ruby
caedmon has quit [Ping timeout: 255 seconds]
Linux_Kerio has joined #ruby
mark22k has quit [Quit: The Lounge - https://thelounge.chat]
mark22k has joined #ruby
Guest31 has joined #ruby
grenierm has joined #ruby
Guest31 has quit [Quit: Client closed]
_ht has quit [Quit: _ht]
Linux_Kerio has quit [Read error: Connection reset by peer]
Linux_Kerio has joined #ruby
cxl has quit [Quit: bye]
cxl has joined #ruby
mange has quit [Ping timeout: 255 seconds]
otisolsen70 has joined #ruby
hightower3 has quit [Ping timeout: 240 seconds]
Linux_Kerio has quit [Ping timeout: 255 seconds]
grenierm has quit [Quit: Client closed]
hightower2 has joined #ruby
hightower2 has quit [Read error: Connection reset by peer]
hightower2 has joined #ruby
konsolebox has joined #ruby
konsolebox has quit [Client Quit]
konsolebox has joined #ruby
willfish has joined #ruby
hightower2 has quit [Read error: Connection reset by peer]
hightower2 has joined #ruby
hightower2 has quit [Read error: Connection reset by peer]
hightower2 has joined #ruby
teclator has quit [Ping timeout: 255 seconds]
teclator has joined #ruby
graywolf has joined #ruby
Aminda has quit [Remote host closed the connection]
Aminda has joined #ruby
Vonter has quit [Ping timeout: 240 seconds]
Vonter has joined #ruby
Vonter has quit [Ping timeout: 260 seconds]
Vonter has joined #ruby
hightower2 has quit [Read error: Connection reset by peer]
Condition_Boy has joined #ruby
ConditionBoy has quit [Ping timeout: 260 seconds]
hightower2 has joined #ruby
Condition_Boy has quit [Read error: Connection reset by peer]
ConditionBoy has joined #ruby
reset has quit [Quit: reset]
Condition_Boy has joined #ruby
Furai has quit [Quit: WeeChat 4.0.5]
ConditionBoy has quit [Ping timeout: 272 seconds]
pjlsergeant__ has quit []
Condition_Boy has quit [Read error: Connection reset by peer]
ConditionBoy has joined #ruby
Condition_Boy has joined #ruby
ConditionBoy has quit [Ping timeout: 255 seconds]
Furai has joined #ruby
Condition_Boy has quit [Read error: Connection reset by peer]
ConditionBoy has joined #ruby
infinityfye has joined #ruby
Vonter has quit [Ping timeout: 240 seconds]
Vonter has joined #ruby
Vonter has quit [Ping timeout: 248 seconds]
Vonter has joined #ruby
Linux_Kerio has joined #ruby
mags has quit [Ping timeout: 255 seconds]
mags has joined #ruby
<johnjaye> hmm. when I do show_doc on Array in the irb prompt and it shows all those methods like any? or count, are those mixins from Enumerable?
<johnjaye> I ask because Array.methods - Enumerable.methods is... not a big list. so Array seems like a thin wrapper around Enumerables
eddof13 has joined #ruby
Thanzex has joined #ruby
hightower2 has quit [Read error: Connection reset by peer]
victori has quit [Quit: ZNC 1.8.2 - https://znc.in]
eddof13 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
victori has joined #ruby
Vonter has quit [Ping timeout: 252 seconds]
Vonter has joined #ruby
konsolebox has quit [Ping timeout: 260 seconds]
eddof13 has joined #ruby
willfish has quit [Quit: WeeChat 4.0.4]
<adam12> johnjaye: Yes, you've got it correct.
<johnjaye> ok
<johnjaye> the truth is revealed
_ht has joined #ruby
hightower2 has joined #ruby
polishdub has quit [Remote host closed the connection]
<leftylink> but Array.methods tells you the methods of Array, not of an array like []. So what does `Array.methods - Enumerable.methods` really tell you? I don't think it tells you anything at all
polishdub has joined #ruby
<leftylink> wouldn't it make much more sense to group each of `[].methods` by Method#owner ?
<leftylink> you would need to turn each of the symbols (returned by #methods) into Method, but I omit obvious details
<leftylink> an example of what I mean
<leftylink> pandabot: rb class C; def foo; end end; [C.methods.include?(:foo), C.new.methods.include?(:foo)]
<pandabot> [false, true] - https://carc.in/#/r/fvtf
<leftylink> since C.methods.include?(:foo) is false, Array.methods tells you nothing.
reset has joined #ruby
<johnjaye> ah ok
konsolebox has joined #ruby
Aminda has quit [Ping timeout: 252 seconds]
Aminda has joined #ruby
dviola has joined #ruby
markong has joined #ruby
eddof13 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
eddof13 has joined #ruby
caedmon has joined #ruby
caedmon has quit [Ping timeout: 255 seconds]
markong has quit [Ping timeout: 246 seconds]
Aminda has quit [Remote host closed the connection]
Aminda has joined #ruby
ule has quit [Changing host]
ule has joined #ruby
Linux_Kerio has quit [Ping timeout: 255 seconds]
infinityfye has quit [Quit: Leaving]
_ht has quit [Quit: _ht]
markong has joined #ruby
otisolsen70 has quit [Quit: Leaving]
polishdub has quit [Ping timeout: 260 seconds]
polishdub has joined #ruby
dostoyevsky2 has quit [Quit: leaving]
dostoyevsky2 has joined #ruby
markong has quit [Ping timeout: 272 seconds]
teclator has quit [Ping timeout: 258 seconds]
konsolebox has quit [Ping timeout: 260 seconds]
reset has quit [Quit: reset]
ruby[bot] has quit [Remote host closed the connection]
ruby[bot] has joined #ruby
eddof13 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
eddof13 has joined #ruby
<havenwood> johnjaye: For what it's worth, you can `Array.instance_methods(false)` or `[].public_methods(false)` to see the methods defined on Array.
<havenwood> johnjaye: If you want to know where a method is defined, you can ask it about its owner. (E.g., with `chunk` you could `[].method(:chunk).owner`.)
<havenwood> johnjaye: In irb take a look at `ls []` or `ls Array`.
konsolebox has joined #ruby
cybniv has joined #ruby
niv has quit [Read error: Connection reset by peer]
eddof13 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
CalimeroTeknik has quit [Ping timeout: 240 seconds]
markong has joined #ruby
Aminda has quit [Ping timeout: 252 seconds]
CalimeroTeknik has joined #ruby
Aminda has joined #ruby
dviola has quit [Ping timeout: 240 seconds]
diego has joined #ruby
diego is now known as Guest1927
toonlink has joined #ruby
<toonlink> i'm attempting to make a "custom variable assignment operator" via essentially using method_missing (i am aware it is the devil) to make undefined variable names return an object that then takes a <=> method that handles assignment. is there any way to do this that'd ensure any typos i make inside of an instance_eval actually raise errors instead of just creating a new "custom operator" object?
<johnjaye> hmm. if i do ls [] then it shows some methods marked Array and others marked Enumerable
<johnjaye> The thing is, any? is clearly an Enumerable thing but it's listed under array
<weaksauce> johnjaye any? is defined on array too
<weaksauce> so that might be why
<johnjaye> i don't follow
<weaksauce> as in they wrote extra code to define any? for array handling instead of the generic enumerable code
<johnjaye> my thought was Enumerable defines any? as an abstract thing. which array then implements
<johnjaye> hmm. wait so Enumerable defines any? as an actual function
<weaksauce> yeah a generic method
<johnjaye> and then Array overrode it?
<weaksauce> look at the code
ksmr has joined #ruby
<johnjaye> it's the same thing
<johnjaye> return true if at least one element satisfies the block
<weaksauce> no the actual code
<weaksauce> it's both C code
<weaksauce> click on the </>
<johnjaye> the generic Enumerable takes a pattern and the array one doesn't?
<johnjaye> oh i had no idea that button did that
<johnjaye> i was confused what you were talking about.
<weaksauce> the array code also test against objects
<johnjaye> yeah it takes an object whereas the enumerable one takes a pattern
<johnjaye> meaning if i give an regexp pattern to an array.any? call it won't do what I expect?
<weaksauce> i am not sure but it seems as though they created an optimized version of array#any?