< :the previous in number
^ :the list in numerical order
> :the next in number
P :the previous (in thread)
N :the next (in thread)
|<:the top of this thread
>|:the next thread
^ :the parent (reply-to)
_:the child (an article replying to this)
>:the elder article having the same parent
<:the youger article having the same parent
---:split window and show thread lists
| :split window (vertically) and show thread lists
~ :close the thread frame
.:the index
..:the index of indices
On Mar 20, 2010, at 03:51 , David Vlad wrote:
> I apologize. I actually managed to get the until loops working after
> some reinstalling. However, the .collect method still dosnt work and I
> really want to use it. The code looks like this:
>
>
> array = [1,2,5,7]
>
> array.collect do |x|
> x = x*2
> end
>
> puts array.inspect
>
>
> After I have run this code it still says the array is [1,2,5,7].
% ri Array.collect
---------------------------------------------------------- Array#collect
array.collect {|item| block } -> an_array
array.map {|item| block } -> an_array
------------------------------------------------------------------------
Invokes _block_ once for each element of _self_. Creates a new
array containing the values returned by the block. See also
+Enumerable#collect+.
a = [ "a", "b", "c", "d" ]
a.collect {|x| x + "!" } #=> ["a!", "b!", "c!", "d!"]
a #=> ["a", "b", "c", "d"]