File tree Expand file tree Collapse file tree 1 file changed +7
-8
lines changed
Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -4073,17 +4073,16 @@ rb_method_compose_to_left(VALUE self, VALUE g)
40734073 * call-seq:
40744074 * self >> g -> a_proc
40754075 *
4076- * Returns a proc that is the composition of this method and the given <i>g</i>.
4077- * The returned proc takes a variable number of arguments, calls this method
4078- * with them then calls <i>g</i> with the result.
4076+ * Returns a proc that is the composition of this method and the given +g+.
40794077 *
4080- * def f(x)
4081- * x * x
4082- * end
4078+ * The returned proc takes a variable number of arguments. It first calls +self+
4079+ * with the arguments, then calls +g+ with the return value of +self+.
4080+ *
4081+ * def f(ary) = ary << 'in f'
40834082 *
40844083 * f = self.method(:f)
4085- * g = proc {|x| x + x }
4086- * p (f >> g).call(2 ) #=> 8
4084+ * g = proc { |ary| ary << 'in proc' }
4085+ * (f >> g).call([] ) # => ["in f", "in proc"]
40874086 */
40884087static VALUE
40894088rb_method_compose_to_right (VALUE self , VALUE g )
You can’t perform that action at this time.
0 commit comments