From: RKA Date: 2013-02-15T07:40:33+09:00 Subject: Re: What are lambda functions used for? --f46d043c7d1659fd1f04d5b6d5fb Content-Type: text/plain; charset=ISO-8859-1 #Okay. #Say I have an array defined as follows: my_array = %w{This is an array of words} #The %w is a fancy way of making an array separated where there's spaces # It could also be done like this my_array_also = ["This", "is', "an", "array", "of", "words"] #Notice how much quicker the above is. #I can do this: my_array.each{|array_element| print array_element + " "} #Resulting in the output: #This is an array of words On Thu, Feb 14, 2013 at 1:59 PM, Mike Glaz wrote: > Ok, that makes sense. Om, would you be able to post the Ruby code for > the specific example you just stated? > > -- > Posted via http://www.ruby-forum.com/. > > --f46d043c7d1659fd1f04d5b6d5fb Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
#Okay.

#Say I have an array defin= ed as follows:

my_array =3D %w{This is= an array of words} #The %w is a fancy way of making an array separated whe= re there's spaces
# It could also be done like this
my_array_also = =3D ["This", "is', "an", "array", &q= uot;of", "words"] #Notice how much quicker the above is.

#I can do this:
my_array.ea= ch{|array_element| print array_element + " "}
#Re= sulting in the output:
#This is an array of words


On Thu,= Feb 14, 2013 at 1:59 PM, Mike Glaz <lists@ruby-forum.com> wrote:
Ok, that makes sense. =A0Om, would you be ab= le to post the Ruby code for
the specific example you just stated?

--f46d043c7d1659fd1f04d5b6d5fb--