Learning clojure day-1

;; Clojure 1.6.0
=> (count a[eee ttt tt])
CompilerException clojure.lang.ArityException: Wrong number of args (2) passed to: core/count--inliner, compiling:(C:\Users\\AppData\Local\Temp\form-init7824848865457405872.clj:1:1)
=> (count [eee tt 565 dfsxf 889 dfgd])
CompilerException java.lang.RuntimeException: Unable to resolve symbol: eee in this context, compiling:(C:\Users\\AppData\Local\Temp\form-init7824848865457405872.clj:1:1)
=> (count ["aaa" "ddd" 56 45 ""])
5
=> (def storages["ssss" "sddsdsd" "333dsfsd"])
#'my-clojureproject1.core/storages
=> (first storages)
ssss
=> (second storages)
sddsdsd
=> (last storages)
333dsfsd
=> (nthext storages 2)
CompilerException java.lang.RuntimeException: Unable to resolve symbol: nthext in this context, compiling:(C:\Users\am055849\AppData\Local\Temp\form-init7824848865457405872.clj:1:1)
=> (nthnext storages 2)
("333dsfsd")
=> (nthnext storages 1)
("sddsdsd" "333dsfsd")
=> (next storages)
("sddsdsd" "333dsfsd")
=> (butlast storages)
("ssss" "sddsdsd")
=> (drop-last 1 storages)
("ssss" "sddsdsd")
=> (filter #(> (count %)3)storages)
("ssss" "sddsdsd" "333dsfsd")
=> (filter #(>(count%)8)storage)
CompilerException java.lang.RuntimeException: Unable to resolve symbol: count% in this context, compiling:(C:\Users\\AppData\Local\Temp\form-init7824848865457405872.clj:1:12)
=> (filter #(> (count %)8) storages)
()
=> (every? #(instance? String %) storages)
true
=> (def more-storages(conj storages "anjana"))
#'my-clojureproject1.core/more-storages
=> more-storages
["ssss" "sddsdsd" "333dsfsd" "anjana"]
=> (conj more-storages "raghu")
["ssss"
 "sddsdsd"
 "333dsfsd"
 "anjana"
 "raghu"]
=> (dij more-storages "ssss")
CompilerException java.lang.RuntimeException: Unable to resolve symbol: dij in this context, compiling:(C:\Users\\AppData\Local\Temp\form-init7824848865457405872.clj:1:1)
=> (disj more-storages "ssss")
ClassCastException clojure.lang.PersistentVector cannot be cast to clojure.lang.IPersistentSet  clojure.core/disj (core.clj:1449)
=> (def less-storages(disj more-storages "ssss"))
CompilerException java.lang.ClassCastException: clojure.lang.PersistentVector cannot be cast to clojure.lang.IPersistentSet, compiling:(form-init7824848865457405872.clj:1:19)
=> (def popsical-map (hash-map :red :cherry ,:anjana:raghu ,:amma:shami))
#'my-clojureproject1.core/popsical-map
=> popsical-map
{:red :cherry,
 :anjana:raghu :amma:shami}
=> (get popsical-map :raghu)
nil
=> (get popsical-map :anjana)
nil
=> popsical-map
{:red :cherry,
 :anjana:raghu :amma:shami}
=> (popsical-map :raghu)
nil
=> (popsical-map :red)
:cherry
=> (popsical-map :anjana)
nil
=> (def popsical-map (hash-map :red :cherry ,:anjana :raghu ,:amma :shami))
#'my-clojureproject1.core/popsical-map
=> (popsical-map :anjana)
:raghu
=> (popsical-map :amma)
:shami
=> (contains? popsical-map :amma)
true

Comments

Popular posts from this blog

defining functions clojure

Integrating Struts2 with Spring Security using Custom Login Form