You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
beautiful-racket/beautiful-racket-lib/br/list.rkt

14 lines
315 B
Racket

8 years ago
#lang racket/base
(require br/define (for-syntax racket/base))
(provide (all-defined-out))
(define-macro (values->list EXPR)
#'(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))