I'm not sure, it doesn't work. I didn't know you could use question mark to get character literals so that's a TIL, but splatting a range like that doesn't work.
You could do this though: (?1..?3).to_a
Did reddit mangle the code? Maybe there's some other syntax feature I'm missing..
33
u/IN-DI-SKU-TA-BELT Jul 09 '23
9
u/[deleted] Jul 09 '23
Someone please benchmark these I need to know which is fastest
1
u/kallebo1337 Jul 09 '23
3 down to one dot reverse
1
u/Practical_Ear_4307 Jul 10 '23
I use python now but I still miss ruby much
1
u/gxwho Aug 03 '23
3rd is php/js style 4th is c++ style