Skip to content

Instantly share code, notes, and snippets.

@notyy
Created July 16, 2012 02:29
Show Gist options
  • Save notyy/3120022 to your computer and use it in GitHub Desktop.
Save notyy/3120022 to your computer and use it in GitHub Desktop.
scala_lecture,ruby comparation4
def postProcess int_list
int_list.map{ |i| i * 2}.each{|l| puts l}
end
list = [1,2,3,4,5]
rs = list.map{ |i| i * 2 }.map{ |i| i + 3 }.reject{|j| j > 10}.map{ |i|i.to_s}
postProcess(rs)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment