<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>shigemk2</author_name>
  <author_url>https://blog.hatena.ne.jp/shigemk2/</author_url>
  <blog_title>by shigemk2</blog_title>
  <blog_url>https://www.shigemk2.com/</blog_url>
  <categories>
    <anon>Scala</anon>
  </categories>
  <description>再帰は再帰なんかじゃない！末尾再帰こそが真の再帰なんだ！ 再帰のあとに他の作業がはいっちゃダメなのが末尾再帰の根幹とのこと。 上が普通の再帰。下が末尾再帰。 具体的には、こういうこと。 n * factorial(n - 1) こんなふうに、再帰のあとに計算が入る奴は末尾再帰じゃないよっていう話です。 gist.github.com 再帰呼出しを往路と復路で考えると、末尾再帰は復路のない再帰呼出しと考えることが出来る。 往路で以下のような式を展開する。 (n * (n - 1 * (n - 2 * (n - 1 * (1))))) で、復路で上の式を計算する。 再帰呼出しは、復路の計算を省くの…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fwww.shigemk2.com%2Fentry%2Ftailrec.scala&quot; title=&quot;Scalaで末尾再帰 - by shigemk2&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>http://ecx.images-amazon.com/images/I/61rNWSOzIhL.jpg</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2015-03-21 16:31:46</published>
  <title>Scalaで末尾再帰</title>
  <type>rich</type>
  <url>https://www.shigemk2.com/entry/tailrec.scala</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
