【Perl,PHP】LLバトルロワイヤル20【Ruby,Python】at TECH
【Perl,PHP】LLバトルロワイヤル20【Ruby,Python】 - 暇つぶし2ch555:デフォルトの名無しさん
12/02/09 23:51:48.99
>>546
お題は、二分岐/多分岐/局所宣言の3つあって、
それぞれについてRuby/Standard ML/Haskell/Pythonでコードを示す

[二分岐]
==== Ruby: 前スレ>>682(上段) ====
 ys = xs.select { |x|
   if test
     if test_1 then test_1_1 else test_1_2 end
   else
     if test_2 then test_2_1 else test_2_2 end
   end
 }
==== Standard ML: 前スレ>>772 ====
 val ys = filter (
   fn x =>
     if test x then (
       if test_1 then test_1_1 else test_1_2
     ) else (
       if test_2 then test_2_1 else test_2_2
     )
 ) xs
(続く)


次ページ
続きを表示
1を表示
最新レス表示
レスジャンプ
類似スレ一覧
スレッドの検索
話題のニュース
おまかせリスト
オプション
しおりを挟む
スレッドに書込
スレッドの一覧
暇つぶし2ch