diff --git a/main.rkt b/main.rkt index dad4b88..6bb9849 100644 --- a/main.rkt +++ b/main.rkt @@ -10,7 +10,8 @@ "string.rkt" "len.rkt" "exception.rkt" - "scribble.rkt") + "scribble.rkt" + "values.rkt") (provide (all-from-out @@ -23,4 +24,5 @@ "string.rkt" "len.rkt" "exception.rkt" - "scribble.rkt")) \ No newline at end of file + "scribble.rkt" + "values.rkt")) \ No newline at end of file diff --git a/values.rkt b/values.rkt new file mode 100644 index 0000000..46e2cc1 --- /dev/null +++ b/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))]))