adam12 changed the topic of #ruby to: Rules: https://ruby-community.com | Ruby 3.0.1, 2.7.3, 2.6.7: https://www.ruby-lang.org | Paste 4+ lines to: https://gist.github.com | Books: https://goo.gl/wpGhoQ | Logs: https://irclog.whitequark.org/ruby | BLM <3
orbyt_ has joined #ruby
niv has joined #ruby
Dooky has joined #ruby
DTZUZU has joined #ruby
TK__ has quit [Ping timeout: 245 seconds]
TheRedGambit has joined #ruby
<TheRedGambit> Hello everyone, I have a question. I am learning Ruby and I made a simple class (Point with x and y attributes), and I am putting these Points in a set. When I try to check if a certain Point(x,y) is in the set, using the ===, the result is always false, even if the Point is in the set
<TheRedGambit> For my Point class I have implemented both the == method and the hash method. Not sure why its not working
<_rg> TheRedGambit: could you paste some code
ByronJohnson has quit [Ping timeout: 252 seconds]
matled has quit [Remote host closed the connection]
matled has joined #ruby
<TheRedGambit> actually, it seems to only get messed up once i do select on the set. i'll investigate further
ByronJohnson has joined #ruby
<TheRedGambit> nvm, didnt realize select returns an array, instead of a set
TheRedGambit has left #ruby ["ERC (IRC client for Emacs 27.2)"]
CommunistWolf has quit [Ping timeout: 250 seconds]
CommunistWolf has joined #ruby
duderonomy has joined #ruby
bamdad has quit [Remote host closed the connection]
bamdad has joined #ruby
canbenshanlo has quit [Ping timeout: 260 seconds]
moldorcoder7 has quit [Quit: %bye mirc%]
SuperLag has quit [Remote host closed the connection]
kinduff has quit [Read error: Connection reset by peer]
kinduff has joined #ruby
moldorcoder7 has joined #ruby
Dooky has quit [Quit: ZZZzzz…]
moldorcoder7 has quit [Client Quit]
SuperLag has joined #ruby
MalkbabY has quit [Remote host closed the connection]
TK__ has joined #ruby
MalkbabY has joined #ruby
SuperLag has quit [Remote host closed the connection]
moldorcoder7 has joined #ruby
moldorcoder7 has quit [Remote host closed the connection]
Dooky has joined #ruby
tabakhase has quit [Quit: ZNC - http://znc.in]
evdubs_ has joined #ruby
tabakhase has joined #ruby
evdubs has quit [Ping timeout: 245 seconds]
moldorcoder7 has joined #ruby
gix has joined #ruby
gix- has quit [Ping timeout: 240 seconds]
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
_ule has joined #ruby
Rudd0 has joined #ruby
m27frogy has quit [Ping timeout: 260 seconds]
ule has quit [Disconnected by services]
_ule is now known as ule
ule has quit [Changing host]
ule has joined #ruby
overy4nder has quit [Remote host closed the connection]
prion has joined #ruby
f1hre has joined #ruby
patr0clus has joined #ruby
f1hre has quit [Remote host closed the connection]
cuerbot has joined #ruby
elcuervo has quit [Ping timeout: 260 seconds]
robotbee has joined #ruby
patr0clus has quit [Quit: Textual IRC Client: www.textualapp.com]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ur5us has joined #ruby
ur5us has quit [Client Quit]
prion has quit [Ping timeout: 260 seconds]
prion has joined #ruby
ChmEarl has quit [Quit: Leaving]
jla has joined #ruby
duderonomy has joined #ruby
Dooky has quit [Quit: ZZZzzz…]
prion has quit [Ping timeout: 260 seconds]
Rudd0 has quit [Ping timeout: 268 seconds]
gemmaro has quit [Quit: gemmaro]
prion has joined #ruby
robotbee has quit [Ping timeout: 268 seconds]
konsolebox has quit [Read error: Connection reset by peer]
ByronJohnson has quit [Ping timeout: 252 seconds]
konsolebox has joined #ruby
MalkbabY has quit [Remote host closed the connection]
MalkbabY has joined #ruby
ByronJohnson has joined #ruby
evdubs__ has joined #ruby
evdubs_ has quit [Ping timeout: 240 seconds]
sagax has quit [Remote host closed the connection]
feriman has joined #ruby
jenrzzz has joined #ruby
Xiti has quit [Read error: Connection reset by peer]
Xiti` has joined #ruby
jla has quit [Ping timeout: 245 seconds]
prion has quit [Ping timeout: 260 seconds]
pwnd_ has quit [Quit: Ping timeout (120 seconds)]
pwnd_ has joined #ruby
rubydoc has joined #ruby
jla has joined #ruby
rubydoc has quit [Remote host closed the connection]
rubydoc has joined #ruby
alexherbo2 has joined #ruby
jamees has joined #ruby
pwnd_ has quit [Quit: Ping timeout (120 seconds)]
pwnd_ has joined #ruby
prion has joined #ruby
moldorcoder7 has quit [Quit: %bye mirc%]
teclator has joined #ruby
al2o3-cr has quit [Ping timeout: 268 seconds]
moldorcoder7 has joined #ruby
jenrzzz has quit [Ping timeout: 246 seconds]
jetchisel has joined #ruby
Rudd0 has joined #ruby
moldorcoder7 has quit [Remote host closed the connection]
prion has quit [Ping timeout: 240 seconds]
al2o3-cr has joined #ruby
jenrzzz has joined #ruby
moldorcoder7 has joined #ruby
TK__ has quit [Ping timeout: 245 seconds]
MalkbabY has quit [Remote host closed the connection]
MalkbabY has joined #ruby
canbenshanlo has joined #ruby
alexherbo2 has quit [Ping timeout: 240 seconds]
teclator has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
alexherbo2 has joined #ruby
feriman has quit [Ping timeout: 240 seconds]
Rudd0^ has joined #ruby
jla has quit [Ping timeout: 245 seconds]
Rudd0 has quit [Read error: Connection reset by peer]
jla has joined #ruby
m27frogy has joined #ruby
Rudd0^ has quit [Ping timeout: 246 seconds]
asgwq12321 has joined #ruby
asgwq12321 is now known as confusedRust
confusedRust has quit [Client Quit]
jenrzzz has quit [Ping timeout: 252 seconds]
jenrzzz has joined #ruby
TrufflePump has quit [Ping timeout: 258 seconds]
jenrzzz has quit [Ping timeout: 268 seconds]
sagax has joined #ruby
User4588 has quit [Ping timeout: 240 seconds]
jenrzzz has joined #ruby
jamees has quit [Quit: Connection closed]
jenrzzz has quit [Ping timeout: 265 seconds]
User4588 has joined #ruby
TrufflePump has joined #ruby
User4588_ has joined #ruby
tpanarch1st has joined #ruby
User4588 has quit [Ping timeout: 268 seconds]
TrufflePump has quit [Ping timeout: 258 seconds]
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 260 seconds]
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 268 seconds]
jenrzzz has joined #ruby
konsolebox has quit [Read error: Connection reset by peer]
konsolebox has joined #ruby
schultza has quit [Ping timeout: 245 seconds]
_nick_ has joined #ruby
jenrzzz has quit [Ping timeout: 252 seconds]
actuallybatman has quit [Ping timeout: 252 seconds]
harlin has joined #ruby
jenrzzz has joined #ruby
noboruma has joined #ruby
Qchmqs has joined #ruby
feriman has joined #ruby
duderonomy has quit [Ping timeout: 240 seconds]
jenrzzz has quit [Ping timeout: 265 seconds]
jenrzzz has joined #ruby
boooooooo has joined #ruby
boooooooo has quit [Excess Flood]
jenrzzz has quit [Ping timeout: 268 seconds]
shtirlic has quit [Ping timeout: 246 seconds]
jenrzzz has joined #ruby
_nick_ has quit [Remote host closed the connection]
jenrzzz has quit [Ping timeout: 252 seconds]
_nick_ has joined #ruby
jenrzzz has joined #ruby
hiroaki has quit [Ping timeout: 260 seconds]
duderonomy has joined #ruby
jenrzzz has quit [Ping timeout: 265 seconds]
Mrgoose has quit [Quit: The Lounge - https://thelounge.chat]
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 252 seconds]
jenrzzz has joined #ruby
creat has quit [Ping timeout: 250 seconds]
jenrzzz has quit [Ping timeout: 246 seconds]
TrufflePump has joined #ruby
TrufflePump has quit [Ping timeout: 258 seconds]
moldorcoder7 has quit [Ping timeout: 240 seconds]
MalkbabY has quit [Remote host closed the connection]
MalkbabY has joined #ruby
creat has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
orbyt_ has joined #ruby
jenrzzz has joined #ruby
moldorcoder7 has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
supercoven has joined #ruby
moldorcoder7 has quit [Ping timeout: 252 seconds]
jenrzzz has joined #ruby
schwegler[m] has quit [Quit: Idle for 30+ days]
Rudd0 has joined #ruby
jenrzzz has quit [Ping timeout: 245 seconds]
moldorcoder7 has joined #ruby
Caerus has quit [Ping timeout: 250 seconds]
hiroaki has joined #ruby
user1 has quit [Ping timeout: 276 seconds]
jenrzzz has joined #ruby
jla has quit [Ping timeout: 240 seconds]
user1 has joined #ruby
helpa has quit [Remote host closed the connection]
helpa has joined #ruby
Mia has joined #ruby
Mia has joined #ruby
Axy has quit [Ping timeout: 240 seconds]
Caerus has joined #ruby
jess has quit []
ChmEarl has joined #ruby
jess has joined #ruby
jenrzzz has quit [Ping timeout: 252 seconds]
jla has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 265 seconds]
moldorcoder7 has quit [Ping timeout: 252 seconds]
actuallybatman has joined #ruby
vondruch has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 252 seconds]
shtirlic has joined #ruby
moldorcoder7 has joined #ruby
alexherbo2 has quit [Ping timeout: 240 seconds]
Mrgoose has joined #ruby
cuerbot has quit [Read error: Connection reset by peer]
elcuervo has joined #ruby
robotbee has joined #ruby
moldorcoder7 has quit [Ping timeout: 265 seconds]
yuesbeez has joined #ruby
TrufflePump has joined #ruby
TrufflePump has quit [Ping timeout: 258 seconds]
Rudd0 has quit [Ping timeout: 246 seconds]
Qchmqs has quit [Remote host closed the connection]
canbenshanlo has quit [Quit: Quit]
jenrzzz has joined #ruby
explorier has joined #ruby
TrufflePump has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
jla has quit [Ping timeout: 245 seconds]
jenrzzz has joined #ruby
jla has joined #ruby
jenrzzz has quit [Ping timeout: 246 seconds]
cer-0 has joined #ruby
evdubs__ is now known as evdubs
TK__ has joined #ruby
MalkbabY has quit [Remote host closed the connection]
MalkbabY has joined #ruby
cer-0 has quit [Quit: leaving]
snickers has joined #ruby
TrufflePump has quit [Ping timeout: 258 seconds]
robotbee has quit [Ping timeout: 265 seconds]
moldorcoder7 has joined #ruby
Mrgoose has quit [Quit: The Lounge - https://thelounge.chat]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
TK__ has quit [Remote host closed the connection]
robotbee has joined #ruby
supercoven has quit [Ping timeout: 245 seconds]
TrufflePump has joined #ruby
explorie1 has joined #ruby
explorier has quit [Ping timeout: 240 seconds]
mozzarella has quit [Ping timeout: 252 seconds]
cd has joined #ruby
mozzarella has joined #ruby
feriman has quit [Ping timeout: 240 seconds]
teclator has joined #ruby
pyra has quit [Quit: Konversation terminated!]
Mrgoose has joined #ruby
hramrach has quit [Ping timeout: 252 seconds]
al2o3-cr has quit [Read error: Connection reset by peer]
hramrach has joined #ruby
robotbee has quit [Ping timeout: 252 seconds]
jla has quit [Remote host closed the connection]
explorie1 has quit [Ping timeout: 265 seconds]
jla has joined #ruby
snickers has quit [Ping timeout: 252 seconds]
al2o3-cr has joined #ruby
explorier has joined #ruby
explorier has quit [Ping timeout: 245 seconds]
ruby[bot] has quit [Remote host closed the connection]
ruby[bot] has joined #ruby
Rudd0 has joined #ruby
teclator has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
ur5us has joined #ruby
Rudd0^ has joined #ruby
Rudd0 has quit [Ping timeout: 252 seconds]
al2o3-cr has quit [Ping timeout: 245 seconds]
al2o3-cr has joined #ruby
romanlevin333236 has quit [Quit: The Lounge - https://thelounge.chat]
romanlevin333236 has joined #ruby
felipec has joined #ruby
wallacer has quit [Read error: Connection reset by peer]
<felipec> Is there a more idiomatic way of replacing elements of an array from another array if not null?
<felipec> I'm doing this: [ 'a', 'b' ].zip([ nil, 'b.fix' ]).map { |a, b| b || a }
wallacer has joined #ruby
Dooky has joined #ruby
TCZ has joined #ruby
<weaksauce> doubtful felipec
<leah2> maybe map with index on b
dinfuehr has quit [Ping timeout: 265 seconds]
<leah2> >> a=['a','b']; [nil, 'b.fix'].map.with_index { |b,i| b || a[i] }
<ruby[bot]> leah2: # => ["a", "b.fix"] (https://carc.in/#/r/b5lu)
<leftylink> the zip seems the way that most closely expresses what is wanted. to do better... on emight need vector operations on arrays, like if you could do [1, 2, 3] + [4, 5, 6] and have it be [5, 7, 9], then so too could you use ||. but you cannot
dinfuehr has joined #ruby
<leftylink> although for this particular one of replacing elements, you might imagine it kind of looks like Hash#merge
<felipec> leftylink: indeed, I was looking for Array#merge initially
<leftylink> but to add / remove things so that merge is usable for this case is too much
<leftylink> indeed
<felipec> Is there no way of doing [ a, b, c ].something => a || b || c ?
<leah2> compact.first ;)
<leftylink> that looks like a .reduce(&:||)
<leftylink> oh dang that's not even valid syntax
<leftylink> too bad
<leftylink> oh right because || isn't a method
<leftylink> because if it were, you wouldn't be able to short circuit
<leftylink> dang.
<weaksauce> isn't there a method that backs it you can call?
<leftylink> doubtful
<leftylink> pinkpandabot: rb false.send(:'||', true)
<pinkpandabot> playpen: No data available - exit 1 - https://carc.in/#/r/b5lv
<leah2> >> [nil, nil, false, 42, nil].any?
<ruby[bot]> leah2: # => true (https://carc.in/#/r/b5lw)
<leah2> hrng
DTZUZU has quit [Read error: Connection reset by peer]
<leftylink> pinkpandabot: rb false.send(:'||', true)
<pinkpandabot> -e:2:in `<main>': undefined method `||' for false:FalseClass (NoMethodError) - 2 more lines - exit 1 - https://carc.in/#/r/b5ly
<leftylink> okay, so it is indeed not a method
<felipec> leah2: nice
<felipec> With that I can reverse the arguments and do:
<felipec> [ nil, 'b.fix' ].zip([ 'a', 'b' ]).map { |e| e.compact.first }
<leah2> >> [nil, nil, false, 42, nil].find(&:itself)
<ruby[bot]> leah2: # => 42 (https://carc.in/#/r/b5lz)
<leftylink> it needs to do some soul searching to find itself
<felipec> LOL
robotbee has joined #ruby
DTZUZU has joined #ruby
explorier has joined #ruby
MalkbabY has quit [Remote host closed the connection]
MalkbabY has joined #ruby
felipec has quit [Remote host closed the connection]
felipec has joined #ruby
explorier has quit [Ping timeout: 268 seconds]
felipec has quit [Remote host closed the connection]
felipec has joined #ruby
jla has quit [Ping timeout: 245 seconds]
orbyt_ has joined #ruby