Last active
August 29, 2015 14:26
-
-
Save eu90h/d3f1de3f72ad03f1be56 to your computer and use it in GitHub Desktop.
the value of values
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(define (f x y) | |
(list (add1 x) (add1 y))) | |
(define (g x y) | |
(values (add1 x) (add1 y))) | |
(define x 1) | |
(define y -1) | |
(let* ([values (f x y)] | |
[new-x (first values)] | |
[new-y (second values)]) | |
...) | |
; compare with this | |
(define-values (new-x new-y) (g x y)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment