RCR 159: Default arg names for closures
submitted by volty on 2003-10-19 21:43:56
This is a legacy RCR. If this is your RCR, please resubmit it using the new format and process.
an_array.map { _1 * 2 }
an_enum.each_with_index { p "at #{_2} we have #{_1}" }
or at least the usual $_ (when mult params) - an array prefixed with '_' or whatever else.
I do like readable code, but in short code it's just boring to type these.
What about using '{' '}' pair for defs too?
Back to RCRchive.
RCR Submission page and RCRchive powered by Ruby, Apache, RuWiki (modified), and RubLog