add values

pull/2/head
Matthew Butterick 10 years ago
parent ccbdb60ddf
commit ad72822c04

@ -10,7 +10,8 @@
"string.rkt" "string.rkt"
"len.rkt" "len.rkt"
"exception.rkt" "exception.rkt"
"scribble.rkt") "scribble.rkt"
"values.rkt")
(provide (provide
(all-from-out (all-from-out
@ -23,4 +24,5 @@
"string.rkt" "string.rkt"
"len.rkt" "len.rkt"
"exception.rkt" "exception.rkt"
"scribble.rkt")) "scribble.rkt"
"values.rkt"))

@ -0,0 +1,13 @@
#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))]))
Loading…
Cancel
Save