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

ruby-changes:38358

From: sho-h <ko1@a...>
Date: Thu, 7 May 2015 22:28:23 +0900 (JST)
Subject: [ruby-changes:38358] sho-h:r50439 (trunk): * proc.c: [DOC] fix Binding#local_variable_set example. [ci skip]

sho-h	2015-05-07 22:28:03 +0900 (Thu, 07 May 2015)

  New Revision: 50439

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=50439

  Log:
    * proc.c: [DOC] fix Binding#local_variable_set example. [ci skip]

  Modified files:
    trunk/ChangeLog
    trunk/proc.c
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 50438)
+++ ChangeLog	(revision 50439)
@@ -1,3 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Thu May  7 22:22:59 2015  Sho Hashimoto  <sho-h@r...>
+
+	* proc.c: [DOC] fix Binding#local_variable_set example. [ci skip]
+
 Thu May  7 11:32:57 2015  NARUSE, Yui  <naruse@r...>
 
 	* Makefile.in (rbconfig.rb): add rule to make.
Index: proc.c
===================================================================
--- proc.c	(revision 50438)
+++ proc.c	(revision 50439)
@@ -476,12 +476,12 @@ bind_local_variable_get(VALUE bindval, V https://github.com/ruby/ruby/blob/trunk/proc.c#L476
  *
  *	def foo
  *  	  a = 1
- *  	  b = binding
- *  	  b.local_variable_set(:a, 2) # set existing local variable `a'
- *  	  b.local_variable_set(:b, 3) # create new local variable `b'
- *  	                              # `b' exists only in binding.
- *  	  b.local_variable_get(:a) #=> 2
- *  	  b.local_variable_get(:b) #=> 3
+ *  	  bind = binding
+ *  	  bind.local_variable_set(:a, 2) # set existing local variable `a'
+ *  	  bind.local_variable_set(:b, 3) # create new local variable `b'
+ *  	                                 # `b' exists only in binding.
+ *  	  p bind.local_variable_get(:a) #=> 2
+ *  	  p bind.local_variable_get(:b) #=> 3
  *  	  p a #=> 2
  *  	  p b #=> NameError
  *  	end

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

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