Skip to content

Instantly share code, notes, and snippets.

@chrisbodhi
Last active August 29, 2015 14:25
Show Gist options
  • Select an option

  • Save chrisbodhi/4013c351d917ea44d860 to your computer and use it in GitHub Desktop.

Select an option

Save chrisbodhi/4013c351d917ea44d860 to your computer and use it in GitHub Desktop.
; #1
(define (sequence low high step)
(let ([next (+ low step)])
(if (>= high low)
(cons low (sequence next high step))
null)))
; #2
(define (string-append-map xs suffix)
(map (lambda (x)
(string-append x suffix))
xs))
; #3
(define (list-nth-mod xs n)
(cond [(< n 0) (error "list-nth-mod: negative number")]
[(null? xs) (error "list-nth-mod: empty list")]
[#t (length xs)]))
@chrisbodhi
Copy link
Author

; WIP on #3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment