<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>m_seki</author_name>
  <author_url>https://blog.hatena.ne.jp/m_seki/</author_url>
  <blog_title>@m_seki の</blog_title>
  <blog_url>https://druby.hatenablog.com/</blog_url>
  <categories>
  </categories>
  <description>名前と値の組の巨大な集合が、名前順にソートされているときに、名前ごとにグルーピングして処理したいんだけど、値の集まりを本物の配列じゃなくてイテレータにしたいときがあるでしょ？んで、Generatorのようにnextで要素を一つずつたどれるようなstreamがあるとしたら、制御構造はどれもいっしょになるだろう、ということでmix-inもできそうなmodule書いてみた。 require 'enumerator' module Reduce module_function def reduce(stream) curr = stream.next rescue [] while curr[0] k…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fdruby.hatenablog.com%2Fentry%2F20081110%2F1226252097&quot; title=&quot;よくあるreduce - @m_seki の&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>2008-11-10 02:34:57</published>
  <title>よくあるreduce</title>
  <type>rich</type>
  <url>https://druby.hatenablog.com/entry/20081110/1226252097</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
