只显示主题贴

Does Swing Need Saving?
  • 进入论坛 Java
Have a look at ...http://davidtran.doublegifts.com/blog/?p=5 module Main where import Data.List permutations [] = [[]] permutations xs = [x:ps | x <- nub xs, ps <- permutations (delete x xs)] digits = [1,2,2,3,4,5] check xs = xs !! 2 /= 4 && abs (p3 - p5) /= 1 where Just p3 = ele ...
http://www.humblelittlerubybook.com/ http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/230983
  • 进入论坛 Ruby
Suninny 写道举QSort这个例子显然不够有说服力。 看看这个用Ruby作的,可与Haskell的版本相媲美: def qsort(list) return [] if (x,*xs=*list).empty? less, more = xs.partition{|y| y < x} qsort(less) + [x] + qsort(more) end Block比List Comprehensions好用多了。 我個人比較不認同. List Comprehensions [ y | y <- xs, y < x ] 非 ...
T55555
搜索本博客
博客分类
最近加入圈子
最新评论
评论排行榜