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 @@ -4050,17 +4050,16 @@ rb_proc_compose_to_right(VALUE self, VALUE g)
40504050 * call-seq:
40514051 * self << g -> a_proc
40524052 *
4053- * Returns a proc that is the composition of this method and the given <i>g</i>.
4054- * The returned proc takes a variable number of arguments, calls <i>g</i> with them
4055- * then calls this method with the result.
4053+ * Returns a proc that is the composition of the given +g+ and this method.
40564054 *
4057- * def f(x)
4058- * x * x
4059- * end
4055+ * The returned proc takes a variable number of arguments. It first calls +g+
4056+ * with the arguments, then calls +self+ with the return value of +g+.
4057+ *
4058+ * def f(ary) = ary << 'in f'
40604059 *
40614060 * f = self.method(:f)
4062- * g = proc {|x| x + x }
4063- * p (f << g).call(2 ) #=> 16
4061+ * g = proc { |ary| ary << 'in proc' }
4062+ * (f << g).call([] ) # => ["in proc", "in f"]
40644063 */
40654064static VALUE
40664065rb_method_compose_to_left (VALUE self , VALUE g )
You can’t perform that action at this time.
0 commit comments