halgari/clojure-py — Issue #34: Call by ref instead of call by symbol
Author: dvogel
Created: 2012-03-02 04:31:47+00:00
State: open

In Clojure, rebinding a symbol to a new function causes the next invocation to call the newly bound function. Here's a contrived example:

user=> (defn one [] 1)
#'user/one
user=> (defn two [] 1)
#'user/two
user=> (defn three [] (+ (one) (two)))
#'user/three
user=> (three)
2
user=> (defn two [] 2)
#'user/two
user=> (three)
3

Here's the same example in clojure-py:

user=> (defn one [] 1)
#user/one
user=> (defn two [] 1)
#user/two
user=> (defn three [] (+ (one) (two)))
#user/three
user=> (three)
2
user=> (defn two [] 2)
#user/two
user=> (three)
2