Re:AngularJS versus Ember
by prollyignored on Sunday June 16, 2013 @07:29PM
(#5890524)
Aha !
Now in,
while m+i is less than the length of S, do:
if W[i] = S[m + i],
if i equals the (length of W)-1,
return m
let i ← i + 1
....
How would I implement the `return m` part ?There is no explicit return value because the functions aren't functions: they are values, thus the result of the algorithm is bound to the value that is bound to the function.
When you write:
(defn square [x]
(* x x))
You are really writing:(def square
(fn [x]
(* x x)))
and x * x is bound to the value of square. There would be no logical reason to have an explicit return value here.
http://clojuredocs.org/clojure_core/clojure.core/let
http://clojuredocs.org/clojure_core/1.2.0/clojure.core/loop http://clojuredocs.org/clojure_core/clojure.core/for Or just: Browse the Clojure cheatsheet: http://clojure.org/cheatsheet