wtaysom
12/02/2022, 5:07 PMwtaysom
12/02/2022, 5:27 PMyield(10, &my_proc)
, which really doesn't work at all. So I said, "&my_proc allows you to pass my_proc as the block to a method, but yield(10, &my_proc) won't usually call my_proc. Can you define a method called silly_yield so that silly_yield(10, &my_proc) does do what think yield is doing?” Here's the reply.wtaysom
12/02/2022, 5:34 PMmy_proc === 10
. I asked vaguely why ===
is defined on Proc, how would you use it? And eventually wrapped up with an example before, it seems, ChatGPT decided I had used too much of its CPU.wtaysom
12/02/2022, 5:36 PMproc(&:odd?)
instead? Let's see the example using that shorter syntax instead."