Skip to content
Browse files

Added 1.2 warning.

  • Loading branch information...
1 parent e9c0d0c commit 70f3b546ceb359921031b3e89198f5b7f207ddb0 @Licenser Licenser committed Aug 20, 2010
Showing with 16 additions and 6 deletions.
  1. +3 −0 README.textile
  2. +13 −6 src/net/licenser/sandbox.clj
View
3 README.textile
@@ -1,3 +1,6 @@
+h1. Warning
+
+In Clojure 1.2 the :initial feature isn't working at the moment!!!
h1. clj-sandbox
Why clj-sandbox?
View
19 src/net/licenser/sandbox.clj
@@ -1,11 +1,8 @@
(ns net.licenser.sandbox
(:use [clojure.contrib.def :only [defnk]]
- (net.licenser.sandbox matcher safe-fns tester jvm))
- (:import (java.util.concurrent FutureTask TimeUnit TimeoutException ExecutionException)))
-
-(try
- (use 'clojure.contrib.seq-utils)
- (catch Exception e (use 'clojure.contrib.seq)))
+ (net.licenser.sandbox matcher safe-fns tester jvm)
+ [clojure.contrib.seq-utils :only [flatten]])
+ (:import [java.util.concurrent FutureTask TimeUnit TimeoutException ExecutionException]))
(def
#^{:doc "Default timeout for the sandbox. It can be changed by the sandbox creators."}
@@ -143,6 +140,11 @@ Also some objects that are known to be dangerous."}
:object-tester default-obj-tester
:initial []
:remember-state 0]
+ (if (and
+ (= "1.2.0" (clojure-version))
+ (not (empty? initial)))
+ (binding [*out* *err*]
+ (println "WARNING: Clojure 1.2 introduced behaviour that breams the :initial functionality, we are working on a fix but at this moment it is NOT working properly!")))
(let [history (atom [])]
(fn sandbox-compiler [form & locals]
(let [form (dot-replace form)]
@@ -207,6 +209,11 @@ Also some objects that are known to be dangerous."}
:object-tester default-obj-tester
:initial []
:remember-state 0]
+ (if (and
+ (= "1.2.0" (clojure-version))
+ (not (empty? initial)))
+ (binding [*out* *err*]
+ (println "WARNING: Clojure 1.2 introduced behaviour that breams the :initial functionality, we are working on a fix but at this moment it is NOT working properly!")))
(let [history (atom [])]
(fn sandbox-executor [form]
(let [form (dot-replace form)]

0 comments on commit 70f3b54

Please sign in to comment.
Something went wrong with that request. Please try again.