<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>riocampos</author_name>
  <author_url>https://blog.hatena.ne.jp/riocampos/</author_url>
  <blog_title>別館 子子子子子子（ねこのここねこ）はてブロ部</blog_title>
  <blog_url>https://riocampos-tech.hatenablog.com/</blog_url>
  <categories>
    <anon>Ruby</anon>
    <anon>tips</anon>
  </categories>
  <description>クロージャ クロージャはブロックの内部に変数を保持できる、ということはいろんなところで書いてあります。 Rubyのブロックはそれ自身をオブジェクト化することができ、そうすることによってメモリ上に独立して存在できるようになる。 lambda { n += 1 } # =&gt; #&lt;Proc:0x0001f57c@-:27&gt; ブロックをオブジェクト化したものはProcクラスのインスタンスであり、callメソッドを呼ぶことによってブロック内の手続きを呼び出すことができる。そしてこの場合でもブロックがその外側で定義されたローカル変数を参照できるという性質は保たれる。このようなブロックの性質はクロージャと呼…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Friocampos-tech.hatenablog.com%2Fentry%2F20140420%2Flambda_proc_and_variables&quot; title=&quot;lambda/Procと変数の関係（クロージャ） - 別館 子子子子子子（ねこのここねこ）はてブロ部&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>2014-04-20 00:00:00</published>
  <title>lambda/Procと変数の関係（クロージャ）</title>
  <type>rich</type>
  <url>https://riocampos-tech.hatenablog.com/entry/20140420/lambda_proc_and_variables</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
