• Shaarli
  • Tag cloud
  • Picture wall
  • Daily
  • RSS
  • Login
4252 shaares
Filters

Array languages for Clojurians

QRCode

As a lisp, Clojure of course qualifies as one such mind-altering substance. (It arguably qualifies again on the basis of its focus on immutability.) But Blazeski’s article points out that array-based languages such as J, its predecessor APL ("A Programming Language"), and the proprietary q are equally mind-expanding. Let’s see what was – and remains – so compelling about the array programming approach to problems, and compare it to Clojure’s approach.

One operator to do both is pretty handy. We can of course replicate each with out-of-the-box Clojure:

(map (partial + 2) [2 3 4]) ; => (4 5 6)
(map + [2 3 4] [1 2 3])     ; => (3 5 7)
http://www.appliedscience.studio/articles/array-programming-for-clojurists.html
December 16, 2024 at 3:04:55 PM EST *
clojure programming
FILLER
Shaarli · The personal, minimalist, super fast, database-free, bookmarking service by the Shaarli community · Documentation
Fold Fold all Expand Expand all Are you sure you want to delete this link? Are you sure you want to delete this tag? The personal, minimalist, super fast, database-free, bookmarking service by the Shaarli community