add `push!` and `pop!`

pull/10/head
Matthew Butterick 8 years ago
parent a0c9de7535
commit d0f83eb24a

@ -4,3 +4,11 @@
(define-macro (values->list EXPR) (define-macro (values->list EXPR)
#'(call-with-values (λ () EXPR) list)) #'(call-with-values (λ () EXPR) list))
(define-macro (push! ID VAL)
#'(set! ID (cons VAL ID)))
(define-macro (pop! ID)
#'(let ([x (car ID)])
(set! ID (cdr ID))
x))
Loading…
Cancel
Save