hwpplayer1 has quit [Remote host closed the connection]
Stenotrophomonas is now known as brokkoli_origin
joako has quit [Quit: quit]
___nick___ has quit [Ping timeout: 276 seconds]
joako has joined #ruby
Rounin has joined #ruby
<havenwood>
nakilon: Curious if an AVX2-optimized version of bary_pack for 64-bit integers with no nails would help.
<havenwood>
A bunch of parallel xors might matter.
<havenwood>
I'm afraid 32-bit would require a separate implementation and it feels like diminishing returns to continue to care.
schne1der has joined #ruby
Vonter has quit [Ping timeout: 252 seconds]
Vonter has joined #ruby
user71 has quit [Quit: Leaving]
hwpplayer1 has joined #ruby
hwpplayer1 has quit [Read error: Connection reset by peer]
schne1der has quit [Ping timeout: 252 seconds]
Linux_Kerio has quit [Ping timeout: 252 seconds]
ruby[bot] has quit [Remote host closed the connection]
ruby[bot] has joined #ruby
GreenResponse has quit [Quit: Leaving]
infinityfye has quit [Quit: Leaving]
rvalue has quit [Read error: Connection reset by peer]
rvalue has joined #ruby
sphex has joined #ruby
<sphex>
so... #to_enum does not have the same ability to "capture" refinements as Symbol#to_proc does? am I getting this right?
<havenwood>
sphex: "Capture refinement" isn't the right terminology since "refinements" are a thing. They're like lexically scoped monkey patches.
<havenwood>
sphex: A proc encloses its binding.
<havenwood>
sphex: An Object#to_enum creates an Enumerator rather than a Proc. They similarly enclose state but Enumerators are for internal and external iteration, so it's pretty specific.
<havenwood>
They're similar in that they're both a shorthand for creating, one a Proc the other an Enumerator.
<havenwood>
sphex: You're likely to call #to_enum on a collection or something that can produce one. A #to_proc is usually used implicitly, where you do `&:a_symbol` to pass a Symbol as a block.
<havenwood>
The `&` calls #to_proc on `a_symbol` and also passes it as a block rather than a regular argument.
<sphex>
havenwood: ok yeah, I was wrong. I thought to_proc could remember the refinements that were in scope at the time it was called but no, it doesn't do that. and to it's no different from to_enum...
<sphex>
well, that makes it harder to make enumeration-style methods in refinements. methods that return an enumerator for themselves when called without a block I mean. the to_enum enumerator can't see the refined methods... you can work around it by creating an Enumerator manually, but kind of annoying, and probably slower...
<sphex>
huh interesting... seems like it's possible to "capture" refinements with the "&" operator. "&:abc" isn't quite the same as "&:abc.to_proc". the implicit "to_proc" is magic.