The FAQ maintained by Github covers most stumbling blocks, some other tips and tricks supplied here.
Add _site to .gitignore. The generated site should not be uploaded to Github since its gets generated by github.
| ;; Datomic example code | |
| ;; | |
| ;; The extent of entity ?x is all datoms that are about ?x. | |
| ;; Drop this into your rules. | |
| ;; | |
| ;; Demonstrates | |
| ;; | |
| ;; 1. recursive query (extent calls itself) | |
| ;; 2. disjunction (different extent bodies are ORed) | |
| ;; 3. component attributes (e.g. your arm is a component, your brother isn't) |
| ;; Datomic example code | |
| ;; make in memory database | |
| (use '[datomic.api :only (q db) :as d]) | |
| (def uri "datomic:mem://matches") | |
| (d/create-database uri) | |
| (def conn (d/connect uri)) | |
| ;; add the match attribute | |
| (d/transact |
| ;; Datomic example code | |
| (use '[datomic.api :only (db q) :as d]) | |
| ;; ?answer binds a scalar | |
| (q '[:find ?answer :in ?answer] | |
| 42) | |
| ;; of course you can bind more than one of anything | |
| (q '[:find ?last ?first :in ?last ?first] | |
| "Doe" "John") |
| (defpackage :fsm | |
| (:use :cl) | |
| (:export :standard-state-machine | |
| :standard-state-machine-event | |
| :state | |
| :defstate | |
| :deffsm)) | |
| (in-package :fsm) | |
| ;; Basic copy-pasta protection |
| (fsm:deffsm hi-fsm () | |
| ()) | |
| (fsm:defstate hi-fsm :initial (fsm c) | |
| (case c | |
| (#\! :error) | |
| (#\H :want-i))) | |
| (fsm:defstate hi-fsm :want-i (fsm c) | |
| (if (char-equal c #\i) |
The FAQ maintained by Github covers most stumbling blocks, some other tips and tricks supplied here.
Add _site to .gitignore. The generated site should not be uploaded to Github since its gets generated by github.
| ;; adopted from http://www.datomic.com/company/resources/getting-started | |
| ;; Clojure 1.4.0 | |
| ;; user=> | |
| (use '[datomic.api :only [q db] :as d]) | |
| ;;=> nil | |
| ;; user=> | |
| (doc d/q) | |
| ;; ------------------------- |
| (in-package :actor) | |
| (defparameter *current-process* (make-process :background nil)) | |
| (define-symbol-macro self *current-process*) | |
| ;; fork | |
| (defun fork-impl (fn) | |
| (let ((proc (make-process))) | |
| (execute-fork-fn fn proc) ; forkしたプロセスを実行する | |
| proc)) |
| #| | |
| UPDATE: this file no longer works with the changes | |
| pushed to github today (2012-09-17) will fix it | |
| soon. | |
| A working overview of the protocol, sequence, | |
| iterator, and iterate+ packages. | |
| These packages are each quite small and are |