~subsetpark/ec

f2085e0178a33674b1f607c88aef1fea388bb606 — Zach Smith 8 months ago 151ca3e
Add pop
2 files changed, 9 insertions(+), 1 deletions(-)

M src/adverbs.janet
M src/parser.janet
M src/adverbs.janet => src/adverbs.janet +8 -1
@@ 159,10 159,17 @@
  qt qf p -- x
  If `p` = 0, applies `qf`.
     else applies `qt`.
 ```
  ```
  (let [p (calc/pop stack)
        qf (calc/pop stack)
        qt (calc/pop stack)]
    (case (p :value)
      0 (do-apply stack qf)
      (do-apply stack qt))))

(defadv pop 1
  ```
  a b --- a
  Pops the top element of the stack.
  ```
  (calc/pop stack))

M src/parser.janet => src/parser.janet +1 -0
@@ 33,6 33,7 @@
                 "arity" adverbs/arity
                 "shape" adverbs/shape
                 "if" adverbs/if
                 "pop" adverbs/pop

                 "sqr" compose/square})