Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Clojure 1.3 released

Name: Anonymous 2011-09-24 3:47

Now with serious performance boost!

https://github.com/clojure/clojure/blob/1.3.x/changes.txt

Name: Anonymous 2011-09-24 8:15

>>5
I really like how it's done in Clojure, clean and simple:

(defn fib ^long [^long n]
  (if (<= n 1)
      1
      (+ (fib (dec n)) (fib (- n 2)))))

Compare to the Common Lisp code, where type hints are smeared all throughout the function:

(defun fib (n)
  (declare (optimize (speed 3) (safety 0))
           (fixnum n))
  (if (<= n 1)
      1
      (the fixnum (+ (fib (1- n)) (fib (- n 2))))))

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List