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
(続く)