How to split a list into two parts in Scheme
问题 Example: (split '(1 2 3 4) '3) the Answer should be: ((1 2 3) 4) The function required 1 list and 1 number, the output should be nested list the nested list consist of all elements of "mylist" which are equal or less than the "num", and the greater number should be on the right of the list. I tried but out put is only one list: (define (split mylist num) (cond ((null? mylist)'()) ((list? (car mylist))(split(car mylist) num)) ((> (car mylist) num)(split(cdr mylist) num)) (else(cons (car mylist