Skip to content

Instantly share code, notes, and snippets.

@8th-Light-Blog
Created June 29, 2011 19:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 8th-Light-Blog/1054713 to your computer and use it in GitHub Desktop.
Save 8th-Light-Blog/1054713 to your computer and use it in GitHub Desktop.
Blog Title: Clojure Libs and Namespaces: require, use, import, and ns (Part 1)
Author: Colin Jones
Date: December 5th, 2010
user=> (clojure.string/split "name,address,city,state,zip,email,phone" #",")
java.lang.ClassNotFoundException: clojure.string (NO_SOURCE_FILE:0)
user=> (require 'clojure.string)
nil
user=> (clojure.string/split "name,address,city,state,zip,email,phone" #",")
["name" "address" "city" "state" "zip" "email" "phone"]
user=> (require 'clojure.string 'clojure.test)
nil
user=> (clojure.string/join " " ["name" "address" "city" "state" "zip" "email" "phone"])
"name address city state zip email phone"
user=> (clojure.test/is (= 1 2))
FAIL in clojure.lang.PersistentList$EmptyList@1 (NO_SOURCE_FILE:10)
expected: (= 1 2)
actual: (not (= 1 2))
false
user=> (require '[clojure.string :as string])
nil
user=> (string/capitalize "foo")
"Foo"
(require ['clojure.string :as 'string])
user=> (require 'clojure.string '[clojure.test :as test])
nil
user=> (test/is (= 1 1))
true
user=> (require '(clojure string test))
nil
user=> (require '(clojure [string :as string] test))
nil
user=> (string/join [1 2 3])
"123"
user=> (require '[clojure.string :as string] :verbose)
(clojure.core/load "/clojure/string")
(clojure.core/in-ns 'user)
(clojure.core/alias 'string 'clojure.string)
nil
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment