From 861219ce4a8c91a6d94c0d138c2f2bf2b3c2337e Mon Sep 17 00:00:00 2001 From: akr Date: Sun, 9 Mar 2008 01:04:46 +0000 Subject: fix doc. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15734 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- array.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'array.c') diff --git a/array.c b/array.c index bf7777dbfd..7e9dcfa073 100644 --- a/array.c +++ b/array.c @@ -1033,7 +1033,7 @@ rb_ary_splice(VALUE ary, long beg, long len, VALUE rpl) * a[0..2] = "A" #=> ["A", "4"] * a[-1] = "Z" #=> ["A", "Z"] * a[1..-1] = nil #=> ["A", nil] - * a[1..-1] = [] #=> ["A"] + * a[1..-1] = [] #=> ["A"] */ static VALUE @@ -3014,13 +3014,14 @@ permute0(long n, long r, long *p, long index, int *used, VALUE values) * When invoked without a block, return an enumerator object instead. * * Examples: + * * a = [1, 2, 3] * a.permutation.to_a #=> [[1,2,3],[1,3,2],[2,1,3],[2,3,1],[3,1,2],[3,2,1]] * a.permutation(1).to_a #=> [[1],[2],[3]] * a.permutation(2).to_a #=> [[1,2],[1,3],[2,1],[2,3],[3,1],[3,2]] * a.permutation(3).to_a #=> [[1,2,3],[1,3,2],[2,1,3],[2,3,1],[3,1,2],[3,2,1]] - * a.permutation(0).to_a #=> [[]]: one permutation of length 0 - * a.permutation(4).to_a #=> [] : no permutations of length 4 + * a.permutation(0).to_a #=> [[]] # one permutation of length 0 + * a.permutation(4).to_a #=> [] # no permutations of length 4 */ static VALUE @@ -3094,13 +3095,14 @@ combi_len(long n, long k) * When invoked without a block, returns an enumerator object instead. * * Examples: + * * a = [1, 2, 3, 4] * a.combination(1).to_a #=> [[1],[2],[3],[4]] * a.combination(2).to_a #=> [[1,2],[1,3],[1,4],[2,3],[2,4],[3,4]] * a.combination(3).to_a #=> [[1,2,3],[1,2,4],[1,3,4],[2,3,4]] * a.combination(4).to_a #=> [[1,2,3,4]] - * a.combination(0).to_a #=> [[]]: one combination of length 0 - * a.combination(5).to_a #=> [] : no combinations of length 5 + * a.combination(0).to_a #=> [[]] # one combination of length 0 + * a.combination(5).to_a #=> [] # no combinations of length 5 * */ -- cgit v1.2.3