               (recur (inc idx))
               (return abort-val))))))))
 
-(def hset-lua-swap "Experimental Lua-based field swap."
+(def hset-swap "Experimental Lua-based field swap."
   (let [script                (encore/slurp-resource "lua/cas-hset.lua")
         cas-hget (let [script (encore/slurp-resource "lua/cas-hget.lua")]
                    (fn [k] (lua script {:k k} {})))]

  (wcar {} (hset-cas "cas-k" "field" [:foo] [:bar]))
  (wcar {} (hget "cas-k" "field")))

(def set-lua-swap "Experimental Lua-based key swap."
  (let [script               (encore/slurp-resource "lua/cas-set.lua")
        cas-get (let [script (encore/slurp-resource "lua/cas-get.lua")]
                  (fn [k] (lua script {:k k} {})))]


(comment (encore/qb 100 (wcar {} (set-lua-swap "swap-k" (fn [?old _] ?old)))))

;;;; Deprecated

(def compare-and-set cas-set) ; DEPRECATED alias
