Last active
January 8, 2018 10:56
-
-
Save ruliana/f2aa2c4847b329363446aaf00eabf3b3 to your computer and use it in GitHub Desktop.
Destructuring when declaring a variable in Racket
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
#lang racket | |
(define some-list (list "b" "a" "c")) | |
(match-define (list xs ... x) some-list) | |
(printf "First elements are ~a\n" xs) | |
(printf "Last element is ~a\n" x) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment