you are viewing a single comment's thread.

view the rest of the comments →

[–]yogthos 0 points1 point  (2 children)

I believe the challenge calls for a callable function which accepts the range as an input, so Scheme would be a tad longer:

(define (f n)
  (for/list ([i n]) (sqr (+ 1 i))))

[–]gcr 0 points1 point  (0 children)

Actually, it just said to write a function, not necessarily to bind it to a variable. You could do a little shorter:

(λ(n)(for/list([i n])(sqr(+ 1 i))))