Permalink
Browse files

Clojure 1.3 compatibility: declare dynamic variables ^:dynamic.

  • Loading branch information...
gcv committed Sep 29, 2011
1 parent fa85a1e commit faf4df007f085b4a117e393d20c769f819a84424
@@ -79,7 +79,7 @@
;;; development server controls
;;; ----------------------------------------------------------------------------
-(defonce *server* (atom nil))
+(defonce ^:dynamic *server* (atom nil))
(defn start [appengine-app & {:keys [port join?] :or {port 8080, join? false}}]
@@ -7,10 +7,10 @@
com.google.appengine.api.taskqueue.dev.LocalTaskQueue))
-(defonce *current-app-id* (atom nil))
-(defonce *current-app-version* (atom nil))
+(defonce ^:dynamic *current-app-id* (atom nil))
+(defonce ^:dynamic *current-app-version* (atom nil))
-(defonce *current-server-port* (atom nil))
+(defonce ^:dynamic *current-server-port* (atom nil))
(defn make-thread-environment-proxy [& {:keys [user-email user-admin?]}]
@@ -8,7 +8,7 @@
org.apache.commons.io.IOUtils))
-(defonce *blobstore-service* (atom nil))
+(defonce ^:dynamic *blobstore-service* (atom nil))
(defn get-blobstore-service []
@@ -3,7 +3,7 @@
(:import [com.google.appengine.api.channel ChannelServiceFactory ChannelMessage]))
-(defonce *channel-service* (atom nil))
+(defonce ^:dynamic *channel-service* (atom nil))
(defrecord ClientStatus [id status])
@@ -26,18 +26,18 @@
;;; helper variables and constants
;;; ----------------------------------------------------------------------------
-(defonce *datastore-service* (atom nil))
+(defonce ^:dynamic *datastore-service* (atom nil))
-(defonce *current-transaction* nil)
+(defonce ^:dynamic *current-transaction* nil)
-(defonce *datastore-read-policy-map*
+(defonce ^:dynamic *datastore-read-policy-map*
{:eventual ReadPolicy$Consistency/EVENTUAL
:strong ReadPolicy$Consistency/STRONG})
-(defonce *datastore-implicit-transaction-policy-map*
+(defonce ^:dynamic *datastore-implicit-transaction-policy-map*
{:auto ImplicitTransactionManagementPolicy/AUTO
:none ImplicitTransactionManagementPolicy/NONE})
@@ -11,16 +11,16 @@
;;; helpers
;;; ----------------------------------------------------------------------------
-(defonce *images-service* (atom nil))
+(defonce ^:dynamic *images-service* (atom nil))
-(defonce *output-formats*
+(defonce ^:dynamic *output-formats*
{:jpg ImagesService$OutputEncoding/JPEG
:jpeg ImagesService$OutputEncoding/JPEG
:png ImagesService$OutputEncoding/PNG})
-;; (defonce *composite-anchor*
+;; (defonce ^:dynamic *composite-anchor*
;; {:bottom Composite$Anchor/BOTTOM_CENTER
;; :bottom-left Composite$Anchor/BOTTOM_LEFT
;; :bottom-right Composite$Anchor/BOTTOM_RIGHT
@@ -5,7 +5,7 @@
MailService$Message MailService$Attachment]))
-(defonce *mail-service* (atom nil))
+(defonce ^:dynamic *mail-service* (atom nil))
(defn get-mail-service []
@@ -8,11 +8,11 @@
appengine_magic.services.datastore.EntityProtocol))
-(defonce *memcache-service* (atom nil))
-(defonce *namespaced-memcache-services* (atom {}))
+(defonce ^:dynamic *memcache-service* (atom nil))
+(defonce ^:dynamic *namespaced-memcache-services* (atom {}))
-(defonce *policy-type-map*
+(defonce ^:dynamic *policy-type-map*
{:always MemcacheService$SetPolicy/SET_ALWAYS
:add-if-not-present MemcacheService$SetPolicy/ADD_ONLY_IF_NOT_PRESENT
:replace-only MemcacheService$SetPolicy/REPLACE_ONLY_IF_PRESENT})
@@ -5,11 +5,11 @@
TaskOptions$Builder TaskOptions$Method]))
-(defonce *default-queue* (atom nil))
-(defonce *named-queues* (atom {}))
+(defonce ^:dynamic *default-queue* (atom nil))
+(defonce ^:dynamic *named-queues* (atom {}))
-(defonce *task-http-methods*
+(defonce ^:dynamic *task-http-methods*
{:post TaskOptions$Method/POST
:delete TaskOptions$Method/DELETE
:get TaskOptions$Method/GET
@@ -8,7 +8,7 @@
HTTPRequest
HTTPMethod]))
-(defonce *urlfetch-service* (atom nil))
+(defonce ^:dynamic *urlfetch-service* (atom nil))
(defn get-urlfetch-service []
(do (when (nil? @*urlfetch-service*)
@@ -2,7 +2,7 @@
(:import [com.google.appengine.api.users User UserService UserServiceFactory]))
-(defonce *user-service* (atom nil))
+(defonce ^:dynamic *user-service* (atom nil))
(defn get-user-service []
@@ -9,13 +9,13 @@
[com.google.apphosting.api ApiProxy]))
-(def *memcache-size-units*
+(def ^:dynamic *memcache-size-units*
{:bytes LocalMemcacheServiceTestConfig$SizeUnit/BYTES
:kb LocalMemcacheServiceTestConfig$SizeUnit/KB
:mb LocalMemcacheServiceTestConfig$SizeUnit/MB})
-(def *logging-levels*
+(def ^:dynamic *logging-levels*
{:all java.util.logging.Level/ALL
:severe java.util.logging.Level/SEVERE
:warning java.util.logging.Level/WARNING

0 comments on commit faf4df0

Please sign in to comment.