South Africa’s biggest forum. Discuss, discover, and connect with thousands of members.
Yes re Javalang; they're however focused on a few other FP branches e.g. pattern matching, laziness, ...
Is clojure something required in your line of work?Languages (most likely to be used): Java, JS
Free time objectives: learn some functional programming via clojure, learn some React, learn some R, learn some Processing
[)roi(];18953088 said:Is clojure something required in your line of work?
The only similarity is the underlying byte code; beyond that Clojure is far more like Lisp than Java. 1st challenge is always bracket blindness...No, just looks interesting and as I'm so familiar with Java it seemed like a good choice
(fn rep
([lst n]
(rep (rest lst)
n
(take n
(repeat (first lst)))))
([lst n out]
(if
(empty? lst)
out
(rep
(rest lst) n
(concat out (take n
(repeat
(first lst))))))))
[)roi(];18953228 said:The only similarity is the underlying byte code; beyond that Clojure is far more like Lisp than Java. 1st challenge is always bracket blindness...
e.g.
PHP:(fn rep ([lst n] (rep (rest lst) n (take n (repeat (first lst))))) ([lst n out] (if (empty? lst) out (rep (rest lst) n (concat out (take n (repeat (first lst))))))))
They wrote a book on Dependency Injection?