CSc 404 Assignment 1

Time To Stop

Assigned
Due

Jan 22
35 pts
Jan 29

Create a Tom's lisp function chop which takes two arguments, some item x and an arbitrary list. It returns the list shortened so it ends at the first appearance of the x. If x does not appear in the list, return the original list. (This includes the case of the empty list, since no x can be in an empty list.) For instance:

Welcome to Tom's Lisp 0.97. Recur well. lsp>(load "chop.lsp") chop lsp>(chop 'zebra '(bear sheep dog cat zebra snake eagle)) (bear sheep dog cat zebra) lsp>(chop 'last '(that one comes last)) (that one comes last) lsp>(chop 'missing '(that one is not there at all)) (that one is not there at all) lsp>(chop 'first '(first we have the item)) (first) lsp>(chop 'bat '(ding bat dinging a bat)) (ding bat) lsp>(chop 'cobra ()) nil lsp>

When your function works, is nicely formatted and documents, submit it using this form.