Skip to content

Instantly share code, notes, and snippets.

@clebio
Created January 24, 2014 15:11
Show Gist options
  • Save clebio/8599071 to your computer and use it in GitHub Desktop.
Save clebio/8599071 to your computer and use it in GitHub Desktop.
Racket list indexing
$ racket
Welcome to Racket v5.1.3.
> (define l '(1 2 3 4 5))
> (list-ref l 2)
3
> (list-ref l 5/2)
list-ref: expects type <non-negative exact integer> as 2nd argument, given: 5/2; other arguments were: '(1 2 3 4 5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment