 
 
 (defn- valid-DSL-index
-  "Takes an item (presumably part of a DSL function requiring an :at
-  index) and a hashmap, and returns an integer index value, or an
-  integer from the hashmap if a keyword. Blows up informatively if
-  neither of those is possible."
+  "Takes an item (presumably part of a DSL function requiring an :at index) and a hashmap, and returns an integer index value, or an integer from the hashmap if a keyword. Blows up informatively if neither of those is possible."
   [item scratch]
   (cond
     (integer? item) item



(defn calculate
  "Takes a PushDSL blob, a vector of keywords referring to scratch
  item keys, a function over _those keys_ (using positional notation),
  and an :as keyword in which to store the result of the function.

  Exceptions when:
  - [args] is not a vector
  - no :as argument is present
  - the wrong number of arguments are provided
  - (does not check for nil arguments)"
  [[interpreter scratch] args fxn & {:keys [as]}]
  (let [locals (map scratch args)
        result (if (vector? args)



(defn- get-nth-of
  "Abstract function invoked by all the X-nth-of DSL functions. Takes a PushDSL blob, a stackname, an :at index (integer or keyword) (but no :as keyword), and returns the index and the item at that index, raising any argument exceptions it finds."
  [[interpreter scratch] stackname & {:keys [at]}]
  (let [old-stack (u/get-stack interpreter stackname)]
    (if (empty? old-stack)
