And now, by the immortal gods! I think nothing more happy than that generation of men we commonly call fools, idiots, lack-wits, and dolts; splendid titles too, as I conceive them. I'll tell you a thing, which at first perhaps may seem foolish and absurd, yet nothing more true. And first they are not afraid of death—no small evil, by Jupiter! They are not tormented with the conscience of evil acts, not terrified with the fables of ghosts, nor frightened with spirits and goblins. They are not distracted with the fear of evils to come nor the hopes of future good. In short, they are not disturbed with those thousand of cares to which this life is subject. They are neither modest, nor fearful, nor ambitious, nor envious, nor love they any man. And lastly, if they should come nearer even to the very ignorance of brutes, they could not sin, for so hold the divines. And now tell me, you wise fool, with how many troublesome cares your mind is continually perplexed; heap together all the discommodities of your life,
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
(page "index.html" | |
(:require-macros [fogus.datalog.bacwn.macros :refer (facts <- ?- make-database)]) | |
(:require [fogus.datalog.bacwn :as bacwn] | |
[fogus.datalog.bacwn.impl.rules :refer [rules-set]] | |
[fogus.datalog.bacwn.impl.database :refer [add-tuples]] | |
[fogus.datalog.bacwn.impl.syntax :refer [explode]] | |
[tailrecursion.hoplon :refer [do!]])) | |
;;; Schema & initial data |
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
(import 'clojure.lang.ExceptionInfo) | |
(defn call-cc [f] | |
(let [v (promise) | |
e (ex-info "cc" {:v v})] | |
(try (f #(do (deliver v %) (throw e))) | |
(catch ExceptionInfo ex | |
(if (identical? ex e) | |
@(:v (ex-data ex)) | |
(throw ex)))))) |
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
(extend-type js/jQuery.Event | |
cljs.core/IDeref | |
(-deref [this] (-> this .-target js/jQuery .val))) | |
;; (input :type "text" | |
;; :click #(.log js/console @%) | |
;; :value "hello") |
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
(page "index.html" | |
(:require-macros [paranav :refer [dbg]]) | |
(:require [tailrecursion.hoplon.reload :refer [reload-all]] | |
[clojure.zip :as z])) | |
(def $ js/jQuery) | |
(when (-> js/window .-location .-hostname (= "localhost")) (reload-all)) | |
(defn ->attr-map "(HLisp attrs workaround)" [m] |
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 seeing [& body] | |
`(do | |
(println "environment" | |
~(->> (keys &env) | |
(mapcat #(vector `'~% %)) | |
(apply hash-map))) | |
(let [res# (do ~@body)] | |
(println "return value" res#) | |
res#))) |
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
(page "index.html" | |
(:require [tailrecursion.hoplon.reload :refer [reload-all]] | |
[goog.string.format] | |
[goog.string :as gstr])) | |
(when (-> js/window .-location .-hostname (= "localhost")) (reload-all)) | |
;;; cells | |
(defc persons |
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
In gherkin line 37: | |
pb_get="^$" | |
^-- SC1000: $ is not used specially and should therefore be escaped. | |
In gherkin line 38: | |
pb_unget="^$" | |
^-- SC1000: $ is not used specially and should therefore be escaped. |
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
(defn make-page | |
[text form-zippers] | |
(flow/build-dataflow | |
[(flow/cell :source cursor 0) | |
(flow/cell :source zippers form-zippers) | |
(flow/cell current-zipper (get ?zippers ?cursor)) | |
(flow/cell printed-zippers (mapv (comp print-clojure z/root) ?zippers)) | |
(flow/cell strings (mapv str ?printed-zippers)) | |
(flow/cell offsets (vec (cons 0 (reductions + (map (comp inc count) ?strings))))) | |
(flow/cell current-printed (?printed-zippers ?cursor)) |
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
//my broken thing :-( | |
macro formula { | |
rule { | |
$name ($args (,) ...) { $body ... } | |
} => { | |
// how to splice args? | |
var $name = mori.formula(function($args) { $body })($args); | |
} | |
} |
OlderNewer