Hi,
I am a scheme newbie so any help or suggestion is appreciated. The follwoing function with the input '((kangaroo Australia) (Racoon USA) (Tiger Bangladesh)) should return '(kangaroo Racoon Tiger) but instead it returns Error: attempt to call a non-procedure
('((kangaroo australia) (racoon usa) (tiger bangladesh)))
What am I doing wrong?
;L is is the list of animals and countries
(define (animalList L)
(cond ((null? L) '())
;caar L gets the first animal then the recursive
;call gets the rest of the animals
(cons ((caar(L)) (animalList(cdr(L)))))
)
)
Kindly help