Skip to content

Instantly share code, notes, and snippets.

(ns net.licenser.clresource
(:use compojure))
(defroutes greeter
(GET "/"
(html [:h1 "Hello World"])))
(ns net.licenser.jsinterpreter.jsparser
(:gen-class))
(defstruct token-struct :kind :value)
(def token (partial struct token-struct))
(defn re-scan
[regexp string]
(let [regexp (re-pattern (str "(?s)^(" regexp ")(.*)"))]
(next (re-find regexp string))))
; Translated from the ruby original by Heinz N. Gies, original by:
;
; The Computer Language Shootout Benchmarks
; http://shootout.alioth.debian.org
;
; contributed by Jesse Millikan
(ns net.licenser.bm.so.binary-trees
(:use clojure.contrib.trace))
class Derefferencer
def initialize obj, val
@obj = obj
@getter = val.to_sym
@setter = "#{val}=".to_sym
end
def set val
@obj.send(@setter, val)
end
(defn chimney [something-to-burn]
(reduce #(conj %1 (cond
(= %2 'wood) '(heat ashes smoke)
(= %2 'tnt) (chimney something-to-burn)
true nil)) '() something-to-burn))
;;; This was installed by package-install.el.
;;; This provides support for the package system and
;;; interfacing with ELPA, the package archive.
;;; Move this code earlier if you want to reference
;;; packages in your .emacs.
(when
(load
(expand-file-name "~/.emacs.d/elpa/package.el"))
(package-initialize))
No message.
[Thrown class java.lang.NullPointerException]
Restarts:
0: [ABORT] Return to SLIME's top level.
(ns utils)
(declare *log*)
(defn log [msg]
(dosync (alter *log* cons msg)))
(ns backend
(:use utils))
heinz@playground:~/epic2-concurrent# java -server -Xms1g -Xmx2g -jar Clepic-standalone.jar
team one: 2000 of 2000
team two: 2000 of 2000
"Elapsed time: 33518.4079 msecs"
log: 1
cycle-log: 17839
team one: 1994 of 2000
team two: 1998 of 2000
"Elapsed time: 31238.4331 msecs"
log: 2
{
"one":
{
"units": [
{
"script": "fighter",
"modules": ["Fighter L", "Small Battery", "fighter Engine", "Laser"]
},
{
"script": "fighter",