<commit_before>(ns cfbt.ch06)

(def great-books ["East of Eden" "The Glass Bead Game"])

great-books ;; ["East of Eden" "The Glass Bead Game"]

(ns-interns *ns*) ;; {great-books #'cfbt.ch06/great-books}
(get (ns-interns *ns*) 'great-books) ;; #'cfbt.ch06/great-books

(deref #'cfbt.ch06/great-books) ;; ["East of Eden" "The Glass Bead Game"]

great-books ;; ["East of Eden" "The Glass Bead Game"]

(def great-books ["The Power of Bees" "The Glass Bead Game"])

great-books ;; ["The Power of Bees" "The Glass Bead Game"]

;; Creating and switching to namespaces
(create-ns 'cheese.taxonomy) ;; #namespace[cheese.taxonomy]

(ns-name (create-ns 'cheese.taxonomy)) ;; cheese.taxonomy

;; Create a new namespace and switch to it
(in-ns 'cheese.analysis) ;; #namespace[cheese.analysis]

(in-ns 'cheese.taxonomy) ;; #namespace[cheese.taxonomy]
(def cheddars ["mild" "medium" "strong" "sharp" "extra sharp"]) ;; #'cheese.taxonomy/cheddars

(in-ns 'cheese.analysis) ;; #namespace[cheese.analysis]

;;cheese.analysis ;; => Exception..
cheese.taxonomy/cheddars ;; ["mild" "medium" "strong" "sharp" "extra sharp"]

;; Using of `refer`

(in-ns 'cheese.taxonomy)
(def chddars ["mild" "medium" "strong" "sharp" "extra sharp"])
(def bries ["Wisconsin" "Somerset" "Brie de Meaux" "Brie de Melun"])
(in-ns 'cheese.analysis)
(clojure.core/refer 'cheese.taxonomy)
bries ;; ["Wisconsin" "Somerset" "Brie de Meaux" "Brie de Melun"]
cheddars ;; ["mild" "medium" "strong" "sharp" "extra sharp"]
(clojure.core/get (clojure.core/ns-map clojure.core/*ns*) 'bries) ;; #'cheese.taxonomy/bries
(clojure.core/get (clojure.core/ns-map clojure.core/*ns*) 'cheddars) ;; #'cheese.taxonomy/cheddars

(clojure.core/refer 'cheese.taxonomy :only ['bries])
bries ;; ["Wisconsin" "Somerset" "Brie de Meaux" "Brie de Melun"]

;; Page :131 (TBC)<commit_msg>Add more example<commit_after>(ns cfbt.ch06)

(def great-books ["East of Eden" "The Glass Bead Game"])

great-books ;; ["East of Eden" "The Glass Bead Game"]

(ns-interns *ns*) ;; {great-books #'cfbt.ch06/great-books}
(get (ns-interns *ns*) 'great-books) ;; #'cfbt.ch06/great-books

(deref #'cfbt.ch06/great-books) ;; ["East of Eden" "The Glass Bead Game"]

great-books ;; ["East of Eden" "The Glass Bead Game"]

(def great-books ["The Power of Bees" "The Glass Bead Game"])

great-books ;; ["The Power of Bees" "The Glass Bead Game"]

;; Creating and switching to namespaces
(create-ns 'cheese.taxonomy) ;; #namespace[cheese.taxonomy]

(ns-name (create-ns 'cheese.taxonomy)) ;; cheese.taxonomy

;; Create a new namespace and switch to it
(in-ns 'cheese.analysis) ;; #namespace[cheese.analysis]

(in-ns 'cheese.taxonomy) ;; #namespace[cheese.taxonomy]
(def cheddars ["mild" "medium" "strong" "sharp" "extra sharp"]) ;; #'cheese.taxonomy/cheddars

(in-ns 'cheese.analysis) ;; #namespace[cheese.analysis]

;;cheese.analysis ;; => Exception..
cheese.taxonomy/cheddars ;; ["mild" "medium" "strong" "sharp" "extra sharp"]

;; Using of `refer`

(in-ns 'cheese.taxonomy)
(def chddars ["mild" "medium" "strong" "sharp" "extra sharp"])
(def bries ["Wisconsin" "Somerset" "Brie de Meaux" "Brie de Melun"])
(in-ns 'cheese.analysis)
(clojure.core/refer 'cheese.taxonomy)
bries ;; ["Wisconsin" "Somerset" "Brie de Meaux" "Brie de Melun"]
cheddars ;; ["mild" "medium" "strong" "sharp" "extra sharp"]
(clojure.core/get (clojure.core/ns-map clojure.core/*ns*) 'bries) ;; #'cheese.taxonomy/bries
(clojure.core/get (clojure.core/ns-map clojure.core/*ns*) 'cheddars) ;; #'cheese.taxonomy/cheddars

(clojure.core/refer 'cheese.taxonomy :only ['bries])
bries ;; ["Wisconsin" "Somerset" "Brie de Meaux"  "Brie de Melun"]

(in-ns 'cheese.analysis)
;; Notice the dash after "defn"
(defn- private-function
  "Just an example function that does nothing!"
  [])

(in-ns 'cheese.taxonomy)
(clojure.core/refer-clojure)
;(cheese.analysis/private-function) ;; Exception
;(refer 'cheese.analysis :only ['private-function]) ;; Exception..

{'fraction_non_alphanumeric': 0.18494897959183673, 'fraction_numerical': 0.004846938775510204, 'mean_word_length': 5.204113924050633, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '484933', 'n_tokens_mistral': 1578, 'n_tokens_neox': 1489, 'n_words': 384}