Define a procedure
likenate
that takes a list and returns the list with the symbol'like
inserted between each pair of adjacent elements in the given list.
I feel like this should be really easy, but I keep getting lists of lists so the check-expects aren't working. I've been stuck on this problem for over an hour. I've tried append and list* and some other things, but I can't figure out how to collapse a list of a list into one list or just get the function to work with the check-expects. Any help on this in BSL+ would be so great. Anyway, this is what I have:
; likenate : List -> List
(check-expect (likenate (list 'here 'be 'dragons))
(list 'here 'like 'be 'like 'dragons))
(check-expect (likenate (list 'that 'is 'so 'cool))
(list 'that 'like 'is 'like 'so 'like 'cool))
(check-expect (likenate (list 'like 'like))
(list 'like 'like 'like))
(define (likenate list_like)
(cond [(empty? list_like) '()]
[else (list (first list_like) 'like (likenate (rest list_like)))
]))