Created
January 24, 2014 15:11
-
-
Save clebio/8599071 to your computer and use it in GitHub Desktop.
Racket list indexing
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
$ 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