<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>yuimat</author_name>
  <author_url>https://blog.hatena.ne.jp/yuimat/</author_url>
  <blog_title>Scala日記</blog_title>
  <blog_url>https://ym.hatenadiary.jp/</blog_url>
  <categories>
    <anon>Scala</anon>
  </categories>
  <description>今日のScalaハマりポイント： for 式内の変数束縛のタイミングが直観に合わない。 挙動をちゃんと知っていれば理解は出来るけれど、気を使って書かなければいけないのはデメリット。 gist.github.com 普通に読むと、iを束縛した後、bestを束縛して、jを回す、それが終わったらまたiを束縛してbestを束縛して…と読めて、結果としてWrappedArray(21, 22, 23, 24, 25)が出力されるはずだと思うわけだけど、実際にはそうはならず、WrappedArray(1, 2, 3, 4, 5)が出力される。 scala -Xprint:parser で for式の部分を…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fym.hatenadiary.jp%2Fentry%2F2015%2F04%2F02%2F115944&quot; title=&quot;for 式内での変数束縛の罠 - Scala日記&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>2015-04-02 11:59:44</published>
  <title>for 式内での変数束縛の罠</title>
  <type>rich</type>
  <url>https://ym.hatenadiary.jp/entry/2015/04/02/115944</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
