Arc Forumnew | comments | leaders | submitlogin
2 points by Pauan 4400 days ago | link | parent

"It looks like http://en.wikipedia.org/wiki/Oz_(programming_language) and its "see also" links are a good starting point."

  fun {Fact N}
     if N =< 0 then 1 else N*{Fact N-1} end
  end

  fun {Comb N K}
     {Fact N} div ({Fact K} * {Fact N-K}) % integers can't overflow in Oz (unless no memory is left)
  end

  fun {SumList List}
     case List of nil then 0
     [] H|T then H+{SumList T} % pattern matching on lists
     end
  end
I found the above to be cool: notice that the function arguments match the function call. This is like what akkartik was talking about: http://arclanguage.org/item?id=16924