<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>unageanu</author_name>
  <author_url>https://blog.hatena.ne.jp/unageanu/</author_url>
  <blog_title>うなの日記</blog_title>
  <blog_url>https://unageanu.hatenablog.com/</blog_url>
  <categories>
    <anon>Ruby</anon>
  </categories>
  <description>catch,throwでネストされたブロックを一気に抜けます。throw で抜けた場合、catchの戻り値はthrowの第2引数です。 puts catch(:A) { 5.times {|i| puts &quot;outer loop:&quot; &lt;&lt; i.to_s 5.times {|j| puts &quot;inner loop:&quot; &lt;&lt; i.to_s &lt;&lt; &quot;-&quot; &lt;&lt; j.to_s throw :A, &quot;cancel&quot; } } &quot;end&quot; } 出力: outer loop:0 inner loop:0-0 cancel throw が実行されなければ、ブロックをただ実行するだけです。この場合、戻り値はブロッ…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Funageanu.hatenablog.com%2Fentry%2F20070514%2F1179118266&quot; title=&quot; ネストされたブロックからの脱出 - うなの日記&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>2007-05-14 13:51:06</published>
  <title> ネストされたブロックからの脱出</title>
  <type>rich</type>
  <url>https://unageanu.hatenablog.com/entry/20070514/1179118266</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
