Skip to content

Instantly share code, notes, and snippets.

@ruliana
Created January 8, 2018 10:40
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/0eea54a4e3a242ad2da3f4eef1c8ba4c to your computer and use it in GitHub Desktop.
Save ruliana/0eea54a4e3a242ad2da3f4eef1c8ba4c to your computer and use it in GitHub Desktop.
Simple example of pattern matching in Racket
#lang racket
(define some-list (list "b" "a" "c"))
(match some-list
[(list "a" x y) (printf "~a, ~a\n" x y)]
[(list "b" x y) (printf "~a, ~a\n" x y)])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment