From f4a0bf04910db6e6b5faac21b2299ce8ce476b59 Mon Sep 17 00:00:00 2001 From: Dario Daic Date: Thu, 24 Nov 2016 10:11:10 +0100 Subject: [PATCH] Edit documentation for IO#print Important changes made: - Delete duplicate sentence regarding global variable "$_" - Split the whole paragraph into three semantically related smaller ones - Emphasiz names of separators - Add "and is a string" where usage of "$'" and "$\" is explained --- io.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/io.c b/io.c index 716bc6d..9c3cb3c 100644 --- a/io.c +++ b/io.c @@ -6971,15 +6971,16 @@ rb_f_printf(int argc, VALUE *argv) * ios.print() -> nil * ios.print(obj, ...) -> nil * - * Writes the given object(s) to ios. The stream must be - * opened for writing. If the output field separator ($,) - * is not nil, it will be inserted between each object. - * If the output record separator ($\\) - * is not nil, it will be appended to the output. If no - * arguments are given, prints $_. Objects that aren't - * strings will be converted by calling their to_s method. - * With no argument, prints the contents of the variable $_. - * Returns nil. + * Writes the given object(s) to ios. The stream must be opened for writing. + * + * Each given object that isn't a string will be converted to one by calling + * its to_s method. It always returns nil. + * + * When called without arguments it prints out the contents of $_. + * If the output field separator ($,) is not nil, + * and is a string, it is inserted between objects. + * If the output record separator ($\\) is not nil, + * and is a string, it is appended to the output. * * $stdout.print("This is ", 100, " percent.\n") * -- 2.7.4