<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>obelisk2</author_name>
  <author_url>https://blog.hatena.ne.jp/obelisk2/</author_url>
  <blog_title>Camera Obscura</blog_title>
  <blog_url>https://obelisk.hatenablog.com/</blog_url>
  <categories>
    <anon>Ruby</anon>
  </categories>
  <description>jp.quora.com まつもとゆきひろさんは、Ruby を「関数型言語と呼ぶのにはだいぶ抵抗があります」といっておられる。これでもう結論は出たようなものだが、それでも、Ruby にはだいぶ関数型言語の考え方が取り入れられているのも事実だ。それをちょっとだけ考えてみる。 Array, Enumerable, Enumerator 配列a = [1, 2, 3]の各要素を 2倍した新しい配列new_aが欲しい。これを「手続き型」プログラミングを使ってやるとどうなるか。 a = [1, 2, 3] new_a = [] for i in a new_a &lt;&lt; i * 2 end new_a #=…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fobelisk.hatenablog.com%2Fentry%2F2024%2F12%2F28%2F220735&quot; title=&quot;Ruby と関数型プログラミングについてのメモ（1） - Camera Obscura&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>2024-12-28 22:07:35</published>
  <title>Ruby と関数型プログラミングについてのメモ（1）</title>
  <type>rich</type>
  <url>https://obelisk.hatenablog.com/entry/2024/12/28/220735</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
