This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (ns repl.core | |
| (:require [clojure.test.check :as tc] | |
| [clojure.test.check.generators :as gen] | |
| [clojure.test.check.properties :as prop] | |
| [clojure.test :as t])) | |
| ;; Wichtig! Clojure 1.4 verwenden! | |
| (comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (ns dbc.core | |
| (:require [schema.core :as s])) | |
| (comment | |
| (cons 3 [4 5]) | |
| (conj 3 [4 5]) | |
| ;; ClassCastException ?!? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (ns type.core | |
| (:require [clojure.core.typed :as t])) | |
| (defn anzahl [c] | |
| (if-not (seq c) | |
| 0 | |
| (inc (anzahl (rest c))))) | |
| (t/ann anzahl [(t/Seqable t/Any) -> t/Int]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (ns ebt.core | |
| (:require [clojure.test :as t :refer [deftest is run-all-tests]] | |
| [midje.sweet :as m :refer [tabular fact]] | |
| [speclj.core :as s :refer [describe it should= run-specs]])) | |
| (defn plus | |
| "I am a bogus addition function" | |
| [a b] | |
| (if (= a b) (+ a b) (+ a a))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (ns repl.core | |
| (:use clojure.algo.monads)) | |
| (declare $assign $int $id $postinc $add $postinc $do' | |
| m-assign m-int m-id m-postinc m-add m-do) | |
| (comment | |
| ;; Monaden |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (ns macros.core | |
| (:use clojure.walk | |
| [clojure.algo.monads])) | |
| (defn my-read [foo] | |
| (let [data (read-string foo) | |
| result (try (eval data) (catch Throwable t (.getMessage t)))] | |
| {:input foo | |
| :read data |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (ns repl.core | |
| (:use clojure.repl)) | |
| (def x -3) | |
| (defrecord Klausurergebnis [matrikel punkte note]) | |
| (comment | |
| ;; --- Wiederholung |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (ns repl.core) | |
| (defn new-thread [f] (.start (Thread. f))) | |
| (comment | |
| ;; Keywords | |
| :foo | |
| ::foo |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (ns repl.greeter.friendly-hello | |
| (:require [clojure.string :as str])) | |
| (defn msg! [& args] | |
| (println "Hello" (str/join " and " args))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (ns repl.core) | |
| (comment | |
| ;; recursion | |
| (use 'clojure.tools.trace) | |
| (deftrace ! [n] | |
| (if (= 1 n) | |
| n |