3 ms·
I've been using Ruby for a while, but I've been using proc/lamba and eval sparingly. It's nice when you need it. I've mostly used proc to delay computation by
by iamwil 19y ago
I've been using Ruby for a while, but I've been using proc/lamba and eval sparingly. It's nice when you need it. I've mostly used proc to delay computation by passing blocks around, and eval to generate code or class_eval to write as if I was writing in the class.
Anyone else use them for anything else?
So, the aha moment was being able to use eval as an interpreter, and lambda to enclose it to pass it around?