Hacker News new | past | comments | ask | show | jobs | submit login

Since you mentioned Clojure and Erlang's pattern matching, I thought it nessicary to reference this Clojure library, [1] defun.

Here's a quick snippet:

    (defun fib
      ([0] 0)
      ([1] 1)
      ([n] (+ (fib (- n 1)) (fib (- n 2)))))
Then:

    (fib 10)
    ;;=> 55
Cool isn't it!

[1] https://github.com/killme2008/defun




That is indeed cool! Seems extremely handy and intuitive.

I've seen more than one control structure library for Clojure that would make certain algorithms more smooth and "easier to read" in code - I just wonder if it's actually confusing for the readers to start pulling in all of these to your project as you see fit.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: