Skip to content

Instantly share code, notes, and snippets.

@kariya-mitsuru
Created July 6, 2016 16:24
Show Gist options
  • Save kariya-mitsuru/670c1b780ebe35d830595cd3c92e07d6 to your computer and use it in GitHub Desktop.
Save kariya-mitsuru/670c1b780ebe35d830595cd3c92e07d6 to your computer and use it in GitHub Desktop.
variable length arguments in scheme
gosh> (define x (lambda (x y . z) (print "x = " x) (print "y = " y) (print "z = " z)))
x
gosh> (x 10 20)
x = 10
y = 20
z = ()
#<undef>
gosh> (x 10 20 30 40 50)
x = 10
y = 20
z = (30 40 50)
#<undef>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment