In Python, I can do something like this:
t = (1, 2) a, b = t
...and a will be 1 and b will be 2. Suppose I have a list \'(1 2) in
\'(1 2)
This works in Racket if you don't want to bring in the match dependency:
match
From a list:
(let-values ([(a b c) (apply values '(1 2 3))]) (+ a b c))
Or directly from a values expression:
(let-values ([(a b c) (values 1 2 3)]) (+ a b c))