[前][次][番号順一覧][スレッド一覧]

ruby-changes:58901

From: Pawe=C5=82 <ko1@a...>
Date: Mon, 25 Nov 2019 09:19:40 +0900 (JST)
Subject: [ruby-changes:58901] ce50af21af (master): Fix the docs for Proc#>>.

https://git.ruby-lang.org/ruby.git/commit/?id=ce50af21af

From ce50af21af3d23e292b73f955a8b12ea9c2038e3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pawe=C5=82=20Przeniczny?= <pawel.przeniczny@a...>
Date: Sun, 24 Nov 2019 23:08:16 +0100
Subject: Fix the docs for Proc#>>.

The docs are wrong about the behaviour of `#>>` (looks like it was copied from `#<<`)
In `(prc >> g).call(n)` _prc_ is called first (with _n_), *then* _g_ is called with the result.

Code examples are OK.

diff --git a/proc.c b/proc.c
index e0ce442..1144940 100644
--- a/proc.c
+++ b/proc.c
@@ -3362,8 +3362,8 @@ rb_proc_compose_to_left(VALUE self, VALUE g) https://github.com/ruby/ruby/blob/trunk/proc.c#L3362
  *     prc >> g -> a_proc
  *
  *  Returns a proc that is the composition of this proc and the given <i>g</i>.
- *  The returned proc takes a variable number of arguments, calls <i>g</i> with them
- *  then calls this proc with the result.
+ *  The returned proc takes a variable number of arguments, calls this proc with them
+ *  then calls <i>g</i> with the result.
  *
  *     f = proc {|x| x * x }
  *     g = proc {|x| x + x }
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]