makelist is a procedure that takes an item and an integer n and returns the item n amount of times.
(define (makelist (n item)
(cond
[(null? item) '()]
[else (cons item (makelist (- n 1)))])))
my procedure returns a syntax error, can anybody help me out?
You can just use:
(make-list n item)🙂Your syntax error is due to incorrect
define.It should be:
Note that you have a extra
(before then.