このディレクトリの索引
#  
#  ■Python
#  print map(lambda x: x*2, filter(lambda x: x>2 and x<5, [1,2,3,4,5]))
#  
#  ■Ruby
#  puts [1,2,3,4,5].select{|i| i > 2 and i < 5}.map{|i| i*2}
#  
#  ■C#
#  new{}{ 1,2,3,4,5 }.Where(x => 2 < x && x < 5).Select(x => x*2);
#  
#  ■Haskell
#  print [x*2| x <-[1,2,3,4,5], x > 2, x < 5] 

'集合[1,2,3,4,5]の2より大きく5より小さい要素を2倍したものの集合を表示する' :-
        findall(_x_2,(
                    member(_x,[1,2,3,4,5]),
                    _x > 2,
                    _x < 5,
                    _x_2 is _x * 2),
                L),
        writef('%t\n',[L]).

'Python: print map(lambda x: x*2, filter(lambda x: x>2 and x<5, [1,2,3,4,5]))' :-
        findall(_x_2,(
                    member(_x,[1,2,3,4,5]),
                    _x > 2,
                    _x < 5,
                    _x_2 is _x * 2),
                L),
        writef('%t\n',[L]).

'Ruby: puts [1,2,3,4,5].select{|i| i > 2 and i < 5}.map{|i| i*2}' :-
        findall(_x_2,(
                    member(_x,[1,2,3,4,5]),
                    _x > 2,
                    _x < 5,
                    _x_2 is _x * 2),
                L),
        writef('%t\n',[L]).

'C#: new{}{ 1,2,3,4,5 }.Where(x => 2 < x && x < 5).Select(x => x*2);' :-
        findall(_x_2,(
                    member(_x,[1,2,3,4,5]),
                    _x > 2,
                    _x < 5,
                    _x_2 is _x * 2),
                L),
        writef('%t\n',[L]).

'Haskell: print [x*2| x <-[1,2,3,4,5], x > 2, x < 5]' :-
        findall(_x_2,(
                    member(_x,[1,2,3,4,5]),
                    _x > 2,
                    _x < 5,
                    _x_2 is _x * 2),
                L),
        writef('%t\n',[L]).