Skip to content

hiredman/Arkham

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

# Arkham

As an interpreter Arkham's goal is to provide fine grained control over the evaluation of a language.

Arkham is written so that the language it interprets follows Clojure's semantics as far as posible.

## Usage

where you would use eval use evil

if you want to change the constructor behaviour for a certain class:

(defmethod ctor Thread [& _]
  (throw (Exception. "DENIED")))

;;=> (evil '(Thread.))
;; #<Exception java.lang.Exception: DENIED>

change the behaviour of method invocation:

(defmethod dot [clojure.lang.Var 'invoke] [& _]
  (throw (Exception. "DENIED")))

;;=> (evil '(.invoke #'+ 1 2))
;; #<Exception java.lang.Exception: DENIED>

change var resolution:

(defmethod get-var #'clojure.core/eval [_ _]  #'arkham.core/evil)

;;=> (evil '#'clojure.core/eval)
;; #'arkham.core/evil
;;=> (evil 'clojure.core/eval)
;; #<core$evil arkham.core$evil@43748549>

*STACK* is replaced with the current stack:

;;=> (evil '(let [x 1 y 2] (loop [x (range 10)] *STACK*)))
;; ({x (0 1 2 3 4 5 6 7 8 9)} #loop {x 1 y 2})

#loop is a special marker on the stack used by recur

## Installation

FIXME: write

## License

Copyright (C) 2010 Kevin Downey

Distributed under the Eclipse Public License, the same as Clojure.

About

lisp interpreter with clojure like semantics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published