class Array
def apply
collect! { |number| yield number }
end
end
a=[1,2,3]
a.apply { |i| i * i }
p a.to_s
The accuracy of metadata is inversely proportional to the square of the distance between the data and the metadata.
Thou shalt have no other gods before Me. Thou shalt not make unto thee a graven image, nor any manner of likeness, of any thing that is in heaven above.
To paraphrase the Matrix, XML guys don't even see the angle brackets anymore
they just see blonde, brunette, redhead
class Array
def apply
each_index { |i| self.[]=(i, yield(self.[](i))) }
end
end
a=[1,2,3]
a.apply { |i| i*i }
p a.to_s