SlideShare a Scribd company logo
へっぽこ
Smalltalker から見
 た Enumerable
  おがさわらなるひこ
 るりま読書会 @ オラクル青山
     2012.08.11
自己紹介
 元、某メーカーで社内ニート
 9ヶ月の実ニートを経て
 今は中堅 SIer で社内ニート
 趣味は印刷技術
  自費でカリフォルニアの会合にも行った
  Gihyo.jp にもレポ書いた (←知らんがな
  TLUG でもプレゼンした (←知らんがな
                         1/16
そんなことより
某雑誌のボンシン
コーで死にそうに
なってるんですが、
こんなところにいて
 大丈夫なのか   2/16
俺と Ruby
 Ruby 書けないんだ (´・ω・`)
  隣の人たちは Ruby でもりもりコード書
  いてますけど
   Enju とかいう単語が聞こえてくる

 Ruby は 1.6 の頃から触ってた
  初代バイブルとか 256 本は持ってる
  Win32OLE で Excel 連携とかよくやった
  そんなレベル
                          3/16
そんなわけで
今日は Smalltalk
の話をしてお茶を
  濁します
Smalltalkも書けるというわけじゃない
           けど……
                     4/16
Smalltalk
  まさか知らん人おらんよね?
   Lisp と並ぶもう Ruby の一人の片親
    でも Lisp にはよく言及されるけど……

   毎回 ReadWriteStream disるの止めて
   あげてください X-(

       Stream <-+- ReadStream
                |
                +- WriteStream <- ReadWriteStream



                                                    5/16
Smalltalk には Module とか
多重継承的なものがない
  Enumerable にあたるものは当然
  存在しない
  でも最近流行りの Trait が最初に
  発表されたのは Smalltalk なのよ
   Squeak / Pharo という実装で使える
   Module はダミークラスを作るけど、
   Trait はクラスのメソッド辞書に突っ込む
                              6/16
クラスとして同じような意味を持
つのは Collection
 Stream も似てるっちゃ似てる
  同じメソッドあるし
  同じメソッドがあるならクラス階層が違っ
  ても呼べるのは Smalltalk も同じ
  duck typing なんてのは 80 年代に通過してます




                               7/16
Enumerable といえばやはり
each
 Smalltalk では do:
  コロンじゅーよー

  (1 to: 10) do: [ :n | Transcript cr; show: n * 2].


 なんだそっくりじゃないか
  はっきりいってパク(ry
                                                   8/16
ぱっと目につく違い
 map とか collect とか inject とか
 はクリソツ
  どうせ Lisp からのパク(ry

 Smalltalk には破壊的操作とか存
 在しないよ(多分
  漢らしく新しいインスタンスを生成する
  shallow copy なのでそんなに問題には
  ならない
                           9/16
  put:at: とかあるから手書きでは可能
ぱっと目につく違い 続き
 Smalltalk は as の多用が目立つ
  ソートするのに asSortedCollection と
  か
  単一化するのに asSet とか

 当たり前だけど「モダンな」機能は
 Ruby のほうが便利そう
  そもそも正規表現ビルトインじゃないしと
  かあるよなー
                             10/16
正直
productive にコ
ード書いてないか
らよくわかりません
スミマセンスミマセ
      ン     11/16
訓練された Smalltalker は
Hierarchy Browser で
Collection を見ても当然動じ
ない
 見てみましょう




                  12/16
えっ、私のクラス……多すぎ?
 Small Class がいいか Big Class
 がいいかは宗派の問題
 「このメソッドは配列のとき意外に呼
 んでもアレ」とかがキモイって人もい
 る
  ぼくとか


                          13/16
貴様は Enumerable のメソッド
をすべて暗記してるのか?
 Smalltalk のことは Smalltalk に聞
 けばいい
  Smalltalker だって Collection に何が
  あるかなんか暗記してない (らしい)

 だからみんなるりま読むよね?
  るりま超サイコーですよ

                               14/16
そして
 たまには Smalltalk も遊んでみて
 ね♪
  個人的には Squeak Smalltalk オススメ




                           15/16
おしまい。




        16/16

More Related Content

More from Naruhiko Ogasawara

さらばデスクトップ?モバイル・クラウド時代のLibreOfficeの挑戦/LibreOffice current status, or the chall...
さらばデスクトップ?モバイル・クラウド時代のLibreOfficeの挑戦/LibreOffice current status, or the chall...さらばデスクトップ?モバイル・クラウド時代のLibreOfficeの挑戦/LibreOffice current status, or the chall...
さらばデスクトップ?モバイル・クラウド時代のLibreOfficeの挑戦/LibreOffice current status, or the chall...Naruhiko Ogasawara
 
最新のデスクトップアプリを使おう:Snap, Flatpak, AppImage
最新のデスクトップアプリを使おう:Snap, Flatpak, AppImage最新のデスクトップアプリを使おう:Snap, Flatpak, AppImage
最新のデスクトップアプリを使おう:Snap, Flatpak, AppImageNaruhiko Ogasawara
 
LibreOffice Asia Conference 2019 Tokyo; what we had achieved, and what's next
LibreOffice Asia Conference 2019 Tokyo; what we had achieved, and what's nextLibreOffice Asia Conference 2019 Tokyo; what we had achieved, and what's next
LibreOffice Asia Conference 2019 Tokyo; what we had achieved, and what's nextNaruhiko Ogasawara
 
The Document Foundationについて / About The Document Foundation
The Document Foundationについて / About The Document FoundationThe Document Foundationについて / About The Document Foundation
The Document Foundationについて / About The Document FoundationNaruhiko Ogasawara
 
TDFと寄付、メンバーシップ、認定制度 / TDF and donation, membership and certification
TDFと寄付、メンバーシップ、認定制度 / TDF and donation, membership and certificationTDFと寄付、メンバーシップ、認定制度 / TDF and donation, membership and certification
TDFと寄付、メンバーシップ、認定制度 / TDF and donation, membership and certificationNaruhiko Ogasawara
 
Building a bridge between Japanese LibreOffice community and the world
Building a bridge between Japanese LibreOffice community and the worldBuilding a bridge between Japanese LibreOffice community and the world
Building a bridge between Japanese LibreOffice community and the worldNaruhiko Ogasawara
 
Happy Software Freedom Day! (Koedo Linux Users Group, Tokyo, Japan)
Happy Software Freedom Day! (Koedo Linux Users Group, Tokyo, Japan)Happy Software Freedom Day! (Koedo Linux Users Group, Tokyo, Japan)
Happy Software Freedom Day! (Koedo Linux Users Group, Tokyo, Japan)Naruhiko Ogasawara
 
宣伝:SeleniumConf Tokyo 2019やりますよ!
宣伝:SeleniumConf Tokyo 2019やりますよ!宣伝:SeleniumConf Tokyo 2019やりますよ!
宣伝:SeleniumConf Tokyo 2019やりますよ!Naruhiko Ogasawara
 
Using latest LibreOffice on openSUSE Leap 15 - by modern packaging systems
Using latest LibreOffice on openSUSE Leap 15 - by modern packaging systemsUsing latest LibreOffice on openSUSE Leap 15 - by modern packaging systems
Using latest LibreOffice on openSUSE Leap 15 - by modern packaging systemsNaruhiko Ogasawara
 
The Document Foundationについて
The Document FoundationについてThe Document Foundationについて
The Document FoundationについてNaruhiko Ogasawara
 
LibreOffice: The Office Suite with Mixing Bowl Culture
LibreOffice: The Office Suite with Mixing Bowl CultureLibreOffice: The Office Suite with Mixing Bowl Culture
LibreOffice: The Office Suite with Mixing Bowl CultureNaruhiko Ogasawara
 
Make It Better Together: コミュニティを主体としたLibreOffice翻訳 / : Community-centered Lib...
Make It Better Together: コミュニティを主体としたLibreOffice翻訳 / : Community-centered Lib...Make It Better Together: コミュニティを主体としたLibreOffice翻訳 / : Community-centered Lib...
Make It Better Together: コミュニティを主体としたLibreOffice翻訳 / : Community-centered Lib...Naruhiko Ogasawara
 
Hospital days in czech / チェコで入院した話
Hospital days in czech / チェコで入院した話Hospital days in czech / チェコで入院した話
Hospital days in czech / チェコで入院した話Naruhiko Ogasawara
 
openSUSEユーザーに向けたLibreOffice入門 / Introduction of LibreOffice for openSUSE users
openSUSEユーザーに向けたLibreOffice入門 / Introduction of LibreOffice for openSUSE usersopenSUSEユーザーに向けたLibreOffice入門 / Introduction of LibreOffice for openSUSE users
openSUSEユーザーに向けたLibreOffice入門 / Introduction of LibreOffice for openSUSE usersNaruhiko Ogasawara
 
Webブラウザで動くOSSオフィスソフト、LibreOffice Onlineの中身に迫る / LibreOffice Online Implementa...
Webブラウザで動くOSSオフィスソフト、LibreOffice Onlineの中身に迫る / LibreOffice Online Implementa...Webブラウザで動くOSSオフィスソフト、LibreOffice Onlineの中身に迫る / LibreOffice Online Implementa...
Webブラウザで動くOSSオフィスソフト、LibreOffice Onlineの中身に迫る / LibreOffice Online Implementa...Naruhiko Ogasawara
 
LibreOfficeの最新動向 / LibreOffice current status
LibreOfficeの最新動向 / LibreOffice current statusLibreOfficeの最新動向 / LibreOffice current status
LibreOfficeの最新動向 / LibreOffice current statusNaruhiko Ogasawara
 
Vertical Writing: typical use-cases and current status in LibreOffice
Vertical Writing: typical use-cases and current status in LibreOfficeVertical Writing: typical use-cases and current status in LibreOffice
Vertical Writing: typical use-cases and current status in LibreOfficeNaruhiko Ogasawara
 
LibreOffice, the free office productive suite and it's status of accessibilit...
LibreOffice, the free office productive suite and it's status of accessibilit...LibreOffice, the free office productive suite and it's status of accessibilit...
LibreOffice, the free office productive suite and it's status of accessibilit...Naruhiko Ogasawara
 

More from Naruhiko Ogasawara (20)

さらばデスクトップ?モバイル・クラウド時代のLibreOfficeの挑戦/LibreOffice current status, or the chall...
さらばデスクトップ?モバイル・クラウド時代のLibreOfficeの挑戦/LibreOffice current status, or the chall...さらばデスクトップ?モバイル・クラウド時代のLibreOfficeの挑戦/LibreOffice current status, or the chall...
さらばデスクトップ?モバイル・クラウド時代のLibreOfficeの挑戦/LibreOffice current status, or the chall...
 
最新のデスクトップアプリを使おう:Snap, Flatpak, AppImage
最新のデスクトップアプリを使おう:Snap, Flatpak, AppImage最新のデスクトップアプリを使おう:Snap, Flatpak, AppImage
最新のデスクトップアプリを使おう:Snap, Flatpak, AppImage
 
LibreOffice Asia Conference 2019 Tokyo; what we had achieved, and what's next
LibreOffice Asia Conference 2019 Tokyo; what we had achieved, and what's nextLibreOffice Asia Conference 2019 Tokyo; what we had achieved, and what's next
LibreOffice Asia Conference 2019 Tokyo; what we had achieved, and what's next
 
小江戸らぐBBQ 2019
小江戸らぐBBQ 2019小江戸らぐBBQ 2019
小江戸らぐBBQ 2019
 
The Document Foundationについて / About The Document Foundation
The Document Foundationについて / About The Document FoundationThe Document Foundationについて / About The Document Foundation
The Document Foundationについて / About The Document Foundation
 
TDFと寄付、メンバーシップ、認定制度 / TDF and donation, membership and certification
TDFと寄付、メンバーシップ、認定制度 / TDF and donation, membership and certificationTDFと寄付、メンバーシップ、認定制度 / TDF and donation, membership and certification
TDFと寄付、メンバーシップ、認定制度 / TDF and donation, membership and certification
 
Building a bridge between Japanese LibreOffice community and the world
Building a bridge between Japanese LibreOffice community and the worldBuilding a bridge between Japanese LibreOffice community and the world
Building a bridge between Japanese LibreOffice community and the world
 
Happy Software Freedom Day! (Koedo Linux Users Group, Tokyo, Japan)
Happy Software Freedom Day! (Koedo Linux Users Group, Tokyo, Japan)Happy Software Freedom Day! (Koedo Linux Users Group, Tokyo, Japan)
Happy Software Freedom Day! (Koedo Linux Users Group, Tokyo, Japan)
 
宣伝:SeleniumConf Tokyo 2019やりますよ!
宣伝:SeleniumConf Tokyo 2019やりますよ!宣伝:SeleniumConf Tokyo 2019やりますよ!
宣伝:SeleniumConf Tokyo 2019やりますよ!
 
Using latest LibreOffice on openSUSE Leap 15 - by modern packaging systems
Using latest LibreOffice on openSUSE Leap 15 - by modern packaging systemsUsing latest LibreOffice on openSUSE Leap 15 - by modern packaging systems
Using latest LibreOffice on openSUSE Leap 15 - by modern packaging systems
 
The Document Foundationについて
The Document FoundationについてThe Document Foundationについて
The Document Foundationについて
 
告知 ー OSnuC Kawagoe 2018
告知 ー OSnuC Kawagoe 2018告知 ー OSnuC Kawagoe 2018
告知 ー OSnuC Kawagoe 2018
 
LibreOffice: The Office Suite with Mixing Bowl Culture
LibreOffice: The Office Suite with Mixing Bowl CultureLibreOffice: The Office Suite with Mixing Bowl Culture
LibreOffice: The Office Suite with Mixing Bowl Culture
 
Make It Better Together: コミュニティを主体としたLibreOffice翻訳 / : Community-centered Lib...
Make It Better Together: コミュニティを主体としたLibreOffice翻訳 / : Community-centered Lib...Make It Better Together: コミュニティを主体としたLibreOffice翻訳 / : Community-centered Lib...
Make It Better Together: コミュニティを主体としたLibreOffice翻訳 / : Community-centered Lib...
 
Hospital days in czech / チェコで入院した話
Hospital days in czech / チェコで入院した話Hospital days in czech / チェコで入院した話
Hospital days in czech / チェコで入院した話
 
openSUSEユーザーに向けたLibreOffice入門 / Introduction of LibreOffice for openSUSE users
openSUSEユーザーに向けたLibreOffice入門 / Introduction of LibreOffice for openSUSE usersopenSUSEユーザーに向けたLibreOffice入門 / Introduction of LibreOffice for openSUSE users
openSUSEユーザーに向けたLibreOffice入門 / Introduction of LibreOffice for openSUSE users
 
Webブラウザで動くOSSオフィスソフト、LibreOffice Onlineの中身に迫る / LibreOffice Online Implementa...
Webブラウザで動くOSSオフィスソフト、LibreOffice Onlineの中身に迫る / LibreOffice Online Implementa...Webブラウザで動くOSSオフィスソフト、LibreOffice Onlineの中身に迫る / LibreOffice Online Implementa...
Webブラウザで動くOSSオフィスソフト、LibreOffice Onlineの中身に迫る / LibreOffice Online Implementa...
 
LibreOfficeの最新動向 / LibreOffice current status
LibreOfficeの最新動向 / LibreOffice current statusLibreOfficeの最新動向 / LibreOffice current status
LibreOfficeの最新動向 / LibreOffice current status
 
Vertical Writing: typical use-cases and current status in LibreOffice
Vertical Writing: typical use-cases and current status in LibreOfficeVertical Writing: typical use-cases and current status in LibreOffice
Vertical Writing: typical use-cases and current status in LibreOffice
 
LibreOffice, the free office productive suite and it's status of accessibilit...
LibreOffice, the free office productive suite and it's status of accessibilit...LibreOffice, the free office productive suite and it's status of accessibilit...
LibreOffice, the free office productive suite and it's status of accessibilit...
 

Recently uploaded

LoRaWAN 4チャンネル電流センサー・コンバーター CS01-LB 日本語マニュアル
LoRaWAN 4チャンネル電流センサー・コンバーター CS01-LB 日本語マニュアルLoRaWAN 4チャンネル電流センサー・コンバーター CS01-LB 日本語マニュアル
LoRaWAN 4チャンネル電流センサー・コンバーター CS01-LB 日本語マニュアルCRI Japan, Inc.
 
2024年度_サイバーエージェント_新卒研修「データベースの歴史」.pptx
2024年度_サイバーエージェント_新卒研修「データベースの歴史」.pptx2024年度_サイバーエージェント_新卒研修「データベースの歴史」.pptx
2024年度_サイバーエージェント_新卒研修「データベースの歴史」.pptxyassun7010
 
MPAなWebフレームワーク、Astroの紹介 (その2) 2024/05/24の勉強会で発表されたものです。
MPAなWebフレームワーク、Astroの紹介 (その2) 2024/05/24の勉強会で発表されたものです。MPAなWebフレームワーク、Astroの紹介 (その2) 2024/05/24の勉強会で発表されたものです。
MPAなWebフレームワーク、Astroの紹介 (その2) 2024/05/24の勉強会で発表されたものです。iPride Co., Ltd.
 
YugabyteDB適用に向けた取り組みと隠れた魅力 (DSS Asia 2024 発表資料)
YugabyteDB適用に向けた取り組みと隠れた魅力 (DSS Asia 2024 発表資料)YugabyteDB適用に向けた取り組みと隠れた魅力 (DSS Asia 2024 発表資料)
YugabyteDB適用に向けた取り組みと隠れた魅力 (DSS Asia 2024 発表資料)NTT DATA Technology & Innovation
 
論文紹介: Offline Q-Learning on diverse Multi-Task data both scales and generalizes
論文紹介: Offline Q-Learning on diverse Multi-Task data both scales and generalizes論文紹介: Offline Q-Learning on diverse Multi-Task data both scales and generalizes
論文紹介: Offline Q-Learning on diverse Multi-Task data both scales and generalizesatsushi061452
 
論文紹介: Exploiting semantic segmentation to boost reinforcement learning in vid...
論文紹介: Exploiting semantic segmentation to boost reinforcement learning in vid...論文紹介: Exploiting semantic segmentation to boost reinforcement learning in vid...
論文紹介: Exploiting semantic segmentation to boost reinforcement learning in vid...atsushi061452
 
20240523_IoTLT_vol111_kitazaki_v1___.pdf
20240523_IoTLT_vol111_kitazaki_v1___.pdf20240523_IoTLT_vol111_kitazaki_v1___.pdf
20240523_IoTLT_vol111_kitazaki_v1___.pdfAyachika Kitazaki
 
2024年5月25日Serverless Meetup大阪 アプリケーションをどこで動かすべきなのか.pptx
2024年5月25日Serverless Meetup大阪 アプリケーションをどこで動かすべきなのか.pptx2024年5月25日Serverless Meetup大阪 アプリケーションをどこで動かすべきなのか.pptx
2024年5月25日Serverless Meetup大阪 アプリケーションをどこで動かすべきなのか.pptxssuserbefd24
 
Amazon Cognitoで実装するパスキー (Security-JAWS【第33回】 勉強会)
Amazon Cognitoで実装するパスキー (Security-JAWS【第33回】 勉強会)Amazon Cognitoで実装するパスキー (Security-JAWS【第33回】 勉強会)
Amazon Cognitoで実装するパスキー (Security-JAWS【第33回】 勉強会)keikoitakurag
 

Recently uploaded (10)

LoRaWAN 4チャンネル電流センサー・コンバーター CS01-LB 日本語マニュアル
LoRaWAN 4チャンネル電流センサー・コンバーター CS01-LB 日本語マニュアルLoRaWAN 4チャンネル電流センサー・コンバーター CS01-LB 日本語マニュアル
LoRaWAN 4チャンネル電流センサー・コンバーター CS01-LB 日本語マニュアル
 
【AI論文解説】Consistency ModelとRectified Flow
【AI論文解説】Consistency ModelとRectified Flow【AI論文解説】Consistency ModelとRectified Flow
【AI論文解説】Consistency ModelとRectified Flow
 
2024年度_サイバーエージェント_新卒研修「データベースの歴史」.pptx
2024年度_サイバーエージェント_新卒研修「データベースの歴史」.pptx2024年度_サイバーエージェント_新卒研修「データベースの歴史」.pptx
2024年度_サイバーエージェント_新卒研修「データベースの歴史」.pptx
 
MPAなWebフレームワーク、Astroの紹介 (その2) 2024/05/24の勉強会で発表されたものです。
MPAなWebフレームワーク、Astroの紹介 (その2) 2024/05/24の勉強会で発表されたものです。MPAなWebフレームワーク、Astroの紹介 (その2) 2024/05/24の勉強会で発表されたものです。
MPAなWebフレームワーク、Astroの紹介 (その2) 2024/05/24の勉強会で発表されたものです。
 
YugabyteDB適用に向けた取り組みと隠れた魅力 (DSS Asia 2024 発表資料)
YugabyteDB適用に向けた取り組みと隠れた魅力 (DSS Asia 2024 発表資料)YugabyteDB適用に向けた取り組みと隠れた魅力 (DSS Asia 2024 発表資料)
YugabyteDB適用に向けた取り組みと隠れた魅力 (DSS Asia 2024 発表資料)
 
論文紹介: Offline Q-Learning on diverse Multi-Task data both scales and generalizes
論文紹介: Offline Q-Learning on diverse Multi-Task data both scales and generalizes論文紹介: Offline Q-Learning on diverse Multi-Task data both scales and generalizes
論文紹介: Offline Q-Learning on diverse Multi-Task data both scales and generalizes
 
論文紹介: Exploiting semantic segmentation to boost reinforcement learning in vid...
論文紹介: Exploiting semantic segmentation to boost reinforcement learning in vid...論文紹介: Exploiting semantic segmentation to boost reinforcement learning in vid...
論文紹介: Exploiting semantic segmentation to boost reinforcement learning in vid...
 
20240523_IoTLT_vol111_kitazaki_v1___.pdf
20240523_IoTLT_vol111_kitazaki_v1___.pdf20240523_IoTLT_vol111_kitazaki_v1___.pdf
20240523_IoTLT_vol111_kitazaki_v1___.pdf
 
2024年5月25日Serverless Meetup大阪 アプリケーションをどこで動かすべきなのか.pptx
2024年5月25日Serverless Meetup大阪 アプリケーションをどこで動かすべきなのか.pptx2024年5月25日Serverless Meetup大阪 アプリケーションをどこで動かすべきなのか.pptx
2024年5月25日Serverless Meetup大阪 アプリケーションをどこで動かすべきなのか.pptx
 
Amazon Cognitoで実装するパスキー (Security-JAWS【第33回】 勉強会)
Amazon Cognitoで実装するパスキー (Security-JAWS【第33回】 勉強会)Amazon Cognitoで実装するパスキー (Security-JAWS【第33回】 勉強会)
Amazon Cognitoで実装するパスキー (Security-JAWS【第33回】 勉強会)
 

へっぽこSmalltalkerからみたEnumerable