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..
View all comments
Show parent comment
4
u/tinco Jul 09 '23
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_aDid reddit mangle the code? Maybe there's some other syntax feature I'm missing..