Skip to content

Instantly share code, notes, and snippets.

@ruliana
Last active January 8, 2018 10:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ruliana/f2aa2c4847b329363446aaf00eabf3b3 to your computer and use it in GitHub Desktop.
Save ruliana/f2aa2c4847b329363446aaf00eabf3b3 to your computer and use it in GitHub Desktop.
Destructuring when declaring a variable in Racket
#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