On a personal note, the best thing about Lisp is that it builds a solution from bottom up - and for creators of a systems it’s - I believe ideal , however to understand another system - the top-down approach is the one that prevails - read from top-down and read a lot!
(int \汉)
(require '[cuerdas.core :as cuerdas])
(cuerdas/alpha? "word")
(cuerdas/alpha-numeric? "word 123")
(cuerdas/alnum? "word 123")
(cuerdas/letters? "汉语")
(.indexOf word "o")
(.length word)
(.isEmpty word)
(.substring word 1 3)
(.subSequence word 1 3)
(.toUpperCase word)
(.toLowerCase word)
(.trim " word ")
Here, the (.toCharArray ) method gives us a Java Array object
we can deal with an Array object using ( get ) method from Clojure
(get (.toCharArray "word") 0)
(require '[cuerdas.core :as cuerdas])
(cuerdas/chars "characters")
(str "a" "b" "c")
(get (.split "name is bond" " ") 2)
(def ls (list "this" "is" "a" "list"))
(peek ls)
(first ls)
(rest ls)
(last ls)
(peek ls)
(drop 3 ls)
(.indexOf "a" ls)
(.lastIndexOf "a" ls)
- doesn’t really matter if we quote it or not
(cons 'a ())
(conj 'ls '("cons"))
(concat ls '("cons"))
count
empty
not-empty
into
conj
distinct?
every?
empty?
not-every?
some
not-any?
(use '[clojure.walk :as walk])
walk
prewalk
prewalk-demo
prewalk-replace
postwalk
postwalk-demo
postwalk-replace
sequential?
associative?
sorted?
counted?
reversible?
(def ls '("this" "is" "a" "list"))
(for [x (range (length-of-list ls))]
(println ( nth ls x)))
- we don’t know what exactly a symbol is
- we need to look into a
(def ls '("this" "is" "a" "list"))
(def look-up (read-line))
(defn length-of-list [ls]
(count ls))
(for [x (range (length-of-list ls))]
(if ( = look-up ( nth ls x))
x
nil
))