This file contains 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 tst.demo.core | |
(:use tupelo.core tupelo.test)) | |
(def wilma 3) | |
; `wilma` is a global symbol that points to | |
; an Var object, that points to | |
; a java.lang.Long object of value `3` | |
(dotest | |
(is= java.lang.Long (type wilma)) |
This file contains 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 tst.demo.core | |
(:use demo.core tupelo.core tupelo.test) | |
(:require [tupelo.core :as t]) ) | |
(defn str->hashcode | |
"Work-alike impl of Java String.hashCode() fn" | |
[str-val] | |
(let [char-codes (mapv int str-val) | |
step-fn (fn step-fn [hash-in char-code] | |
(let [hash-out (+ char-code |
This file contains 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
(defmacro with-properties | |
"Temporarily redefine jvm system properties to include entries from `props-user`." | |
[props-user & body] | |
`(let [props-orig# (into {} (for [[prop-key# prop-val#] ~props-user] | |
[prop-key# (System/getProperty prop-key#)]))] | |
(doseq [prop-key# (keys ~props-user)] | |
(System/setProperty prop-key# (get ~props-user prop-key#))) | |
(try | |
~@body | |
(finally |
This file contains 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
package expr; | |
import java.io.InputStream; | |
import static java.lang.System.in; | |
import static java.lang.System.out; | |
class Gopher implements Runnable { | |
public void run() { | |
try { |
This file contains 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 tst.clj.core | |
(:use clj.core | |
clojure.test | |
tupelo.core)) | |
(def first-char \a) | |
(def first-char-val (int first-char)) | |
(defn str->codes | |
[arg-str] |