2014-05-02 21:37:11 +00:00
|
|
|
(ns koans.01-equalities
|
|
|
|
|
(:require [koan-engine.core :refer :all]))
|
2014-01-26 00:04:22 +00:00
|
|
|
|
2010-02-06 16:49:53 +00:00
|
|
|
(meditations
|
2013-02-26 02:46:19 +00:00
|
|
|
"We shall contemplate truth by testing reality, via equality"
|
2016-03-27 19:35:46 +00:00
|
|
|
(= true true)
|
2010-02-19 22:14:03 +00:00
|
|
|
|
2013-02-26 02:46:19 +00:00
|
|
|
"To understand reality, we must compare our expectations against reality"
|
2016-03-27 19:35:46 +00:00
|
|
|
(= 2 (+ 1 1))
|
2010-02-19 22:14:03 +00:00
|
|
|
|
2010-07-26 23:20:42 +00:00
|
|
|
"You can test equality of many things"
|
2016-03-27 19:35:46 +00:00
|
|
|
(= (+ 3 4) 7 (+ 2 5))
|
2010-10-29 15:18:09 +00:00
|
|
|
|
|
|
|
|
"Some things may appear different, but be the same"
|
2016-03-27 19:35:46 +00:00
|
|
|
(= true (= 2 2/1))
|
2010-10-29 15:18:09 +00:00
|
|
|
|
|
|
|
|
"You cannot generally float to heavens of integers"
|
2016-03-27 19:35:46 +00:00
|
|
|
(= false (= 2 2.0))
|
2010-10-29 15:18:09 +00:00
|
|
|
|
|
|
|
|
"But a looser equality is also possible"
|
2016-03-27 19:35:46 +00:00
|
|
|
(= true (== 2.0 2))
|
2010-11-04 13:01:34 +00:00
|
|
|
|
2013-03-04 23:06:46 +00:00
|
|
|
"Something is not equal to nothing"
|
2016-03-27 19:35:46 +00:00
|
|
|
(= true (not (= 1 nil)))
|
2013-03-04 23:06:46 +00:00
|
|
|
|
2013-03-04 23:30:00 +00:00
|
|
|
"Strings, and keywords, and symbols: oh my!"
|
2016-03-27 19:35:46 +00:00
|
|
|
(= false (= "hello" :hello 'hello))
|
2013-03-04 23:30:00 +00:00
|
|
|
|
|
|
|
|
"Make a keyword with your keyboard"
|
2016-03-27 19:35:46 +00:00
|
|
|
(= :hello (keyword "hello"))
|
2013-03-04 23:30:00 +00:00
|
|
|
|
|
|
|
|
"Symbolism is all around us"
|
2016-03-27 19:35:46 +00:00
|
|
|
(= 'hello (symbol "hello"))
|
2013-03-04 23:30:00 +00:00
|
|
|
|
2016-03-25 21:53:55 +00:00
|
|
|
"What could be equivalent to nothing?"
|
2016-03-25 18:12:04 +00:00
|
|
|
(= __ nil)
|
|
|
|
|
|
2010-11-04 13:01:34 +00:00
|
|
|
"When things cannot be equal, they must be different"
|
2016-03-27 19:35:46 +00:00
|
|
|
(not= :fill-in-the-blank :not-equal))
|