Hello ruby-talk,
some suggestions for ruby:
1. list comprehension
{ |x<-0...n| x*2 }
{ |n, x<-0...n, y<-0..x| [x,y] }
2. default argument name to block/method
map {_*2} list # same as map {|x| x*2} list
map {_.lc} list # same as map {|x| x.lc} list
def x2 => _*2 # def x2(x); x*2; end
--
Best regards,
Bulat mailto:bulatz / integ.ru