Implement 'partition' in Scheme

Issue #33 new
Katie Burke created an issue

partition should return two values: a new list containing only the elements for which procedure returns true, and a new list containing only the elements for which procedure returns #f. The elements of the returned lists appear in the same order as they appeared in the original list.
Source: http://www.scheme.com/tspl4/objects.html#./objects:s56
This example should return:
(1 3)
(2 4)

(partition odd? '(1 2 3 4))

Traceback (most recent call last):
File "stdin", line 1, col 2
RunTimeError: unbound variable 'partition'

Comments (3)

  1. Log in to comment