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.
14 lines
328 B
Racket
14 lines
328 B
Racket
#lang racket/base
|
|
(require (for-syntax racket/base))
|
|
|
|
(provide (all-defined-out))
|
|
|
|
(define-syntax (values->list stx)
|
|
(syntax-case stx ()
|
|
[(_ values-expr) #'(call-with-values (λ () values-expr) list)]))
|
|
|
|
|
|
(define-syntax (apply-values stx)
|
|
(syntax-case stx ()
|
|
[(_ proc values) #'(apply proc (values->list values))]))
|