mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* proc.c: [DOC] fix Binding#local_variable_set example. [ci skip]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50439 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
8869cdf576
commit
daed912954
2 changed files with 10 additions and 6 deletions
|
@ -1,3 +1,7 @@
|
|||
Thu May 7 22:22:59 2015 Sho Hashimoto <sho-h@ruby-lang.org>
|
||||
|
||||
* proc.c: [DOC] fix Binding#local_variable_set example. [ci skip]
|
||||
|
||||
Thu May 7 11:32:57 2015 NARUSE, Yui <naruse@ruby-lang.org>
|
||||
|
||||
* Makefile.in (rbconfig.rb): add rule to make.
|
||||
|
|
12
proc.c
12
proc.c
|
@ -476,12 +476,12 @@ bind_local_variable_get(VALUE bindval, VALUE sym)
|
|||
*
|
||||
* 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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue