diff --git a/.gitignore b/.gitignore index d18f225..5211373 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,6 @@ pom.xml.asc /.nrepl-port .hgignore .hg/ +out +notes +.idea/ \ No newline at end of file diff --git a/src/propeller/push/state.cljc b/src/propeller/push/state.cljc index 5026dec..f06bc89 100755 --- a/src/propeller/push/state.cljc +++ b/src/propeller/push/state.cljc @@ -38,9 +38,9 @@ ;; Returns the top item on the stack (defn peek-stack [state stack] - (if-let [top-item (first (get state stack))] - top-item - :no-stack-item)) + (if (empty? (get state stack)) + :no-stack-item + (first (get state stack)))) ;; Returns the top n items on the stack, as a chunk. If there are less than n ;; items on the stack, returns the entire stack