<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>kwatch</author_name>
  <author_url>https://blog.hatena.ne.jp/kwatch/</author_url>
  <blog_title>kなんとかの日記</blog_title>
  <blog_url>https://kwatch.hatenadiary.org/</blog_url>
  <categories>
    <anon>rubinius</anon>
  </categories>
  <description>Evanから資料が上がってこないので、Rubiniusで遊んでみる。 次のコードは、あるメソッドの中から呼び出し元のローカル変数を変更するサンプル。 もちろんRubinius限定。 def f() var = 1 g(var) # var が 2 に変更される puts &quot;f(): var=#{var}&quot; #=&gt; &quot;f(): var=2&quot; end def g(x) ## 呼び出し元のローカル変数の値を操作する context = MethodContext.current.sender v = context.locals[0] # context.locals[:a] とできて欲しい con…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fkwatch.hatenadiary.org%2Fentry%2F20080614%2F1213457717&quot; title=&quot; 呼び出し元のローカル変数を変更する - kなんとかの日記&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2008-06-14 00:35:17</published>
  <title> 呼び出し元のローカル変数を変更する</title>
  <type>rich</type>
  <url>https://kwatch.hatenadiary.org/entry/20080614/1213457717</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
