00:01
orbyt_ has joined #ruby
00:01
niv has joined #ruby
00:06
Dooky has joined #ruby
00:08
DTZUZU has joined #ruby
00:14
TK__ has quit [Ping timeout: 245 seconds]
00:22
TheRedGambit has joined #ruby
00:23
<
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
00:24
<
TheRedGambit >
For my Point class I have implemented both the == method and the hash method. Not sure why its not working
00:28
<
_rg >
TheRedGambit: could you paste some code
00:34
ByronJohnson has quit [Ping timeout: 252 seconds]
00:35
matled has quit [Remote host closed the connection]
00:35
matled has joined #ruby
00:40
<
TheRedGambit >
actually, it seems to only get messed up once i do select on the set. i'll investigate further
00:41
ByronJohnson has joined #ruby
00:46
<
TheRedGambit >
nvm, didnt realize select returns an array, instead of a set
00:46
TheRedGambit has left #ruby ["ERC (IRC client for Emacs 27.2)"]
00:54
CommunistWolf has quit [Ping timeout: 250 seconds]
00:55
CommunistWolf has joined #ruby
00:57
duderonomy has joined #ruby
01:01
bamdad has quit [Remote host closed the connection]
01:03
bamdad has joined #ruby
01:33
canbenshanlo has quit [Ping timeout: 260 seconds]
01:35
moldorcoder7 has quit [Quit: %bye mirc%]
01:35
SuperLag has quit [Remote host closed the connection]
02:06
kinduff has quit [Read error: Connection reset by peer]
02:06
kinduff has joined #ruby
02:19
moldorcoder7 has joined #ruby
02:21
Dooky has quit [Quit: ZZZzzz…]
02:24
moldorcoder7 has quit [Client Quit]
02:25
SuperLag has joined #ruby
02:26
MalkbabY has quit [Remote host closed the connection]
02:27
TK__ has joined #ruby
02:27
MalkbabY has joined #ruby
02:33
SuperLag has quit [Remote host closed the connection]
02:47
moldorcoder7 has joined #ruby
02:49
moldorcoder7 has quit [Remote host closed the connection]
02:52
Dooky has joined #ruby
03:01
evdubs_ has joined #ruby
03:03
tabakhase has joined #ruby
03:04
evdubs has quit [Ping timeout: 245 seconds]
03:09
moldorcoder7 has joined #ruby
03:18
gix has joined #ruby
03:19
gix- has quit [Ping timeout: 240 seconds]
03:35
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
03:59
_ule has joined #ruby
04:00
Rudd0 has joined #ruby
04:03
m27frogy has quit [Ping timeout: 260 seconds]
04:03
ule has quit [Disconnected by services]
04:03
_ule is now known as ule
04:04
ule has quit [Changing host]
04:04
ule has joined #ruby
04:15
overy4nder has quit [Remote host closed the connection]
04:20
prion has joined #ruby
04:34
f1hre has joined #ruby
04:49
patr0clus has joined #ruby
04:53
f1hre has quit [Remote host closed the connection]
04:55
cuerbot has joined #ruby
04:57
elcuervo has quit [Ping timeout: 260 seconds]
04:58
robotbee has joined #ruby
05:06
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
05:08
ur5us has joined #ruby
05:11
ur5us has quit [Client Quit]
05:25
prion has quit [Ping timeout: 260 seconds]
05:25
prion has joined #ruby
05:52
ChmEarl has quit [Quit: Leaving]
05:55
jla has joined #ruby
05:57
duderonomy has joined #ruby
05:57
Dooky has quit [Quit: ZZZzzz…]
06:00
prion has quit [Ping timeout: 260 seconds]
06:01
Rudd0 has quit [Ping timeout: 268 seconds]
06:03
gemmaro has quit [Quit: gemmaro]
06:08
prion has joined #ruby
06:11
robotbee has quit [Ping timeout: 268 seconds]
06:21
konsolebox has quit [Read error: Connection reset by peer]
06:23
ByronJohnson has quit [Ping timeout: 252 seconds]
06:23
konsolebox has joined #ruby
06:29
MalkbabY has quit [Remote host closed the connection]
06:30
MalkbabY has joined #ruby
06:30
ByronJohnson has joined #ruby
06:33
evdubs__ has joined #ruby
06:36
evdubs_ has quit [Ping timeout: 240 seconds]
06:58
sagax has quit [Remote host closed the connection]
06:59
feriman has joined #ruby
07:03
jenrzzz has joined #ruby
07:03
Xiti has quit [Read error: Connection reset by peer]
07:03
Xiti` has joined #ruby
07:19
jla has quit [Ping timeout: 245 seconds]
07:21
prion has quit [Ping timeout: 260 seconds]
07:43
pwnd_ has quit [Quit: Ping timeout (120 seconds)]
07:43
pwnd_ has joined #ruby
07:52
rubydoc has joined #ruby
07:54
jla has joined #ruby
08:07
rubydoc has quit [Remote host closed the connection]
08:09
rubydoc has joined #ruby
08:12
alexherbo2 has joined #ruby
08:43
jamees has joined #ruby
08:44
pwnd_ has quit [Quit: Ping timeout (120 seconds)]
08:45
pwnd_ has joined #ruby
08:47
prion has joined #ruby
09:25
moldorcoder7 has quit [Quit: %bye mirc%]
09:32
teclator has joined #ruby
09:58
al2o3-cr has quit [Ping timeout: 268 seconds]
09:59
moldorcoder7 has joined #ruby
09:59
jenrzzz has quit [Ping timeout: 246 seconds]
09:59
jetchisel has joined #ruby
10:00
Rudd0 has joined #ruby
10:00
moldorcoder7 has quit [Remote host closed the connection]
10:01
prion has quit [Ping timeout: 240 seconds]
10:01
al2o3-cr has joined #ruby
10:12
jenrzzz has joined #ruby
10:15
moldorcoder7 has joined #ruby
10:19
TK__ has quit [Ping timeout: 245 seconds]
10:36
MalkbabY has quit [Remote host closed the connection]
10:36
MalkbabY has joined #ruby
10:42
canbenshanlo has joined #ruby
10:51
alexherbo2 has quit [Ping timeout: 240 seconds]
10:53
alexherbo2 has joined #ruby
10:56
feriman has quit [Ping timeout: 240 seconds]
10:57
Rudd0^ has joined #ruby
10:57
jla has quit [Ping timeout: 245 seconds]
10:58
Rudd0 has quit [Read error: Connection reset by peer]
10:59
jla has joined #ruby
11:01
m27frogy has joined #ruby
11:07
Rudd0^ has quit [Ping timeout: 246 seconds]
11:12
asgwq12321 has joined #ruby
11:12
asgwq12321 is now known as confusedRust
11:14
confusedRust has quit [Client Quit]
11:16
jenrzzz has quit [Ping timeout: 252 seconds]
11:19
jenrzzz has joined #ruby
11:21
TrufflePump has quit [Ping timeout: 258 seconds]
11:24
jenrzzz has quit [Ping timeout: 268 seconds]
11:31
sagax has joined #ruby
11:35
User4588 has quit [Ping timeout: 240 seconds]
11:37
jenrzzz has joined #ruby
11:46
jamees has quit [Quit: Connection closed]
11:46
jenrzzz has quit [Ping timeout: 265 seconds]
11:47
User4588 has joined #ruby
11:48
TrufflePump has joined #ruby
11:49
User4588_ has joined #ruby
11:51
tpanarch1st has joined #ruby
11:52
User4588 has quit [Ping timeout: 268 seconds]
11:55
TrufflePump has quit [Ping timeout: 258 seconds]
11:58
jenrzzz has joined #ruby
12:08
jenrzzz has quit [Ping timeout: 260 seconds]
12:20
jenrzzz has joined #ruby
12:24
jenrzzz has quit [Ping timeout: 268 seconds]
12:36
jenrzzz has joined #ruby
12:42
konsolebox has quit [Read error: Connection reset by peer]
12:46
konsolebox has joined #ruby
12:46
schultza has quit [Ping timeout: 245 seconds]
12:53
_nick_ has joined #ruby
12:55
jenrzzz has quit [Ping timeout: 252 seconds]
13:02
actuallybatman has quit [Ping timeout: 252 seconds]
13:04
harlin has joined #ruby
13:07
jenrzzz has joined #ruby
13:08
noboruma has joined #ruby
13:11
Qchmqs has joined #ruby
13:13
feriman has joined #ruby
13:16
duderonomy has quit [Ping timeout: 240 seconds]
13:23
jenrzzz has quit [Ping timeout: 265 seconds]
13:36
jenrzzz has joined #ruby
13:36
boooooooo has joined #ruby
13:36
boooooooo has quit [Excess Flood]
13:40
jenrzzz has quit [Ping timeout: 268 seconds]
13:42
shtirlic has quit [Ping timeout: 246 seconds]
13:52
jenrzzz has joined #ruby
13:57
_nick_ has quit [Remote host closed the connection]
13:57
jenrzzz has quit [Ping timeout: 252 seconds]
13:57
_nick_ has joined #ruby
14:02
jenrzzz has joined #ruby
14:08
hiroaki has quit [Ping timeout: 260 seconds]
14:09
duderonomy has joined #ruby
14:16
jenrzzz has quit [Ping timeout: 265 seconds]
14:29
jenrzzz has joined #ruby
14:34
jenrzzz has quit [Ping timeout: 252 seconds]
14:41
jenrzzz has joined #ruby
14:45
creat has quit [Ping timeout: 250 seconds]
14:45
jenrzzz has quit [Ping timeout: 246 seconds]
14:45
TrufflePump has joined #ruby
14:50
TrufflePump has quit [Ping timeout: 258 seconds]
14:51
moldorcoder7 has quit [Ping timeout: 240 seconds]
14:54
MalkbabY has quit [Remote host closed the connection]
14:55
MalkbabY has joined #ruby
14:55
creat has joined #ruby
14:57
jenrzzz has joined #ruby
15:01
jenrzzz has quit [Ping timeout: 240 seconds]
15:12
orbyt_ has joined #ruby
15:16
jenrzzz has joined #ruby
15:34
moldorcoder7 has joined #ruby
15:46
jenrzzz has quit [Ping timeout: 240 seconds]
15:48
supercoven has joined #ruby
15:55
moldorcoder7 has quit [Ping timeout: 252 seconds]
15:58
jenrzzz has joined #ruby
16:00
schwegler[m] has quit [Quit: Idle for 30+ days]
16:00
Rudd0 has joined #ruby
16:03
jenrzzz has quit [Ping timeout: 245 seconds]
16:12
moldorcoder7 has joined #ruby
16:14
Caerus has quit [Ping timeout: 250 seconds]
16:15
hiroaki has joined #ruby
16:15
user1 has quit [Ping timeout: 276 seconds]
16:16
jenrzzz has joined #ruby
16:16
jla has quit [Ping timeout: 240 seconds]
16:17
user1 has joined #ruby
16:17
helpa has quit [Remote host closed the connection]
16:18
helpa has joined #ruby
16:18
Mia has joined #ruby
16:18
Mia has joined #ruby
16:21
Axy has quit [Ping timeout: 240 seconds]
16:21
Caerus has joined #ruby
16:21
ChmEarl has joined #ruby
16:21
jess has joined #ruby
16:27
jenrzzz has quit [Ping timeout: 252 seconds]
16:35
jla has joined #ruby
16:40
jenrzzz has joined #ruby
16:45
jenrzzz has quit [Ping timeout: 265 seconds]
16:51
moldorcoder7 has quit [Ping timeout: 252 seconds]
16:54
actuallybatman has joined #ruby
16:55
vondruch has joined #ruby
16:57
jenrzzz has joined #ruby
17:02
jenrzzz has quit [Ping timeout: 252 seconds]
17:12
shtirlic has joined #ruby
17:12
moldorcoder7 has joined #ruby
17:13
alexherbo2 has quit [Ping timeout: 240 seconds]
17:19
Mrgoose has joined #ruby
17:27
cuerbot has quit [Read error: Connection reset by peer]
17:27
elcuervo has joined #ruby
17:39
robotbee has joined #ruby
17:40
moldorcoder7 has quit [Ping timeout: 265 seconds]
17:47
yuesbeez has joined #ruby
17:50
TrufflePump has joined #ruby
17:55
TrufflePump has quit [Ping timeout: 258 seconds]
18:00
Rudd0 has quit [Ping timeout: 246 seconds]
18:12
Qchmqs has quit [Remote host closed the connection]
18:17
canbenshanlo has quit [Quit: Quit]
18:26
jenrzzz has joined #ruby
18:30
explorier has joined #ruby
18:33
TrufflePump has joined #ruby
18:36
jenrzzz has quit [Ping timeout: 240 seconds]
18:47
jla has quit [Ping timeout: 245 seconds]
18:48
jenrzzz has joined #ruby
18:51
jla has joined #ruby
18:52
jenrzzz has quit [Ping timeout: 246 seconds]
19:02
cer-0 has joined #ruby
19:07
evdubs__ is now known as evdubs
19:07
TK__ has joined #ruby
19:08
MalkbabY has quit [Remote host closed the connection]
19:08
MalkbabY has joined #ruby
19:18
cer-0 has quit [Quit: leaving]
19:23
snickers has joined #ruby
19:33
TrufflePump has quit [Ping timeout: 258 seconds]
19:42
robotbee has quit [Ping timeout: 265 seconds]
19:48
moldorcoder7 has joined #ruby
20:06
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
20:11
TK__ has quit [Remote host closed the connection]
20:15
robotbee has joined #ruby
20:19
supercoven has quit [Ping timeout: 245 seconds]
20:19
TrufflePump has joined #ruby
20:26
explorie1 has joined #ruby
20:28
explorier has quit [Ping timeout: 240 seconds]
20:37
mozzarella has quit [Ping timeout: 252 seconds]
20:48
cd has joined #ruby
20:50
mozzarella has joined #ruby
20:53
feriman has quit [Ping timeout: 240 seconds]
20:58
teclator has joined #ruby
21:15
pyra has quit [Quit: Konversation terminated!]
21:19
Mrgoose has joined #ruby
21:23
hramrach has quit [Ping timeout: 252 seconds]
21:34
al2o3-cr has quit [Read error: Connection reset by peer]
21:37
hramrach has joined #ruby
21:37
robotbee has quit [Ping timeout: 252 seconds]
21:41
jla has quit [Remote host closed the connection]
21:43
explorie1 has quit [Ping timeout: 265 seconds]
21:45
jla has joined #ruby
21:47
snickers has quit [Ping timeout: 252 seconds]
21:48
al2o3-cr has joined #ruby
21:49
explorier has joined #ruby
21:54
explorier has quit [Ping timeout: 245 seconds]
22:00
ruby[bot] has quit [Remote host closed the connection]
22:00
ruby[bot] has joined #ruby
22:00
Rudd0 has joined #ruby
22:07
ur5us has joined #ruby
22:16
Rudd0^ has joined #ruby
22:19
Rudd0 has quit [Ping timeout: 252 seconds]
22:24
al2o3-cr has quit [Ping timeout: 245 seconds]
22:26
al2o3-cr has joined #ruby
22:35
romanlevin333236 has joined #ruby
22:37
felipec has joined #ruby
22:38
wallacer has quit [Read error: Connection reset by peer]
22:38
<
felipec >
Is there a more idiomatic way of replacing elements of an array from another array if not null?
22:38
<
felipec >
I'm doing this: [ 'a', 'b' ].zip([ nil, 'b.fix' ]).map { |a, b| b || a }
22:39
wallacer has joined #ruby
22:39
Dooky has joined #ruby
22:45
TCZ has joined #ruby
22:45
<
weaksauce >
doubtful felipec
22:47
<
leah2 >
maybe map with index on b
22:48
dinfuehr has quit [Ping timeout: 265 seconds]
22:49
<
leah2 >
>> a=['a','b']; [nil, 'b.fix'].map.with_index { |b,i| b || a[i] }
22:49
<
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
22:50
dinfuehr has joined #ruby
22:50
<
leftylink >
although for this particular one of replacing elements, you might imagine it kind of looks like Hash#merge
22:51
<
felipec >
leftylink: indeed, I was looking for Array#merge initially
22:51
<
leftylink >
but to add / remove things so that merge is usable for this case is too much
22:51
<
felipec >
Is there no way of doing [ a, b, c ].something => a || b || c ?
22:51
<
leah2 >
compact.first ;)
22:51
<
leftylink >
that looks like a .reduce(&:||)
22:52
<
leftylink >
oh dang that's not even valid syntax
22:52
<
leftylink >
too bad
22:52
<
leftylink >
oh right because || isn't a method
22:52
<
leftylink >
because if it were, you wouldn't be able to short circuit
22:53
<
weaksauce >
isn't there a method that backs it you can call?
22:53
<
leftylink >
doubtful
22:53
<
leftylink >
pinkpandabot: rb false.send(:'||', true)
22:54
<
leah2 >
>> [nil, nil, false, 42, nil].any?
22:54
DTZUZU has quit [Read error: Connection reset by peer]
22:54
<
leftylink >
pinkpandabot: rb false.send(:'||', true)
22:54
<
pinkpandabot >
-e:2:in `<main>': undefined method `||' for false:FalseClass (NoMethodError) - 2 more lines - exit 1 -
https://carc.in/#/r/b5ly
22:54
<
leftylink >
okay, so it is indeed not a method
22:55
<
felipec >
leah2: nice
22:55
<
felipec >
With that I can reverse the arguments and do:
22:55
<
felipec >
[ nil, 'b.fix' ].zip([ 'a', 'b' ]).map { |e| e.compact.first }
22:56
<
leah2 >
>> [nil, nil, false, 42, nil].find(&:itself)
22:56
<
leftylink >
it needs to do some soul searching to find itself
22:57
robotbee has joined #ruby
22:58
DTZUZU has joined #ruby
23:07
explorier has joined #ruby
23:10
MalkbabY has quit [Remote host closed the connection]
23:10
MalkbabY has joined #ruby
23:14
felipec has quit [Remote host closed the connection]
23:16
felipec has joined #ruby
23:16
explorier has quit [Ping timeout: 268 seconds]
23:30
felipec has quit [Remote host closed the connection]
23:30
felipec has joined #ruby
23:36
jla has quit [Ping timeout: 245 seconds]
23:55
orbyt_ has joined #ruby