Question: Coding must be done in the Lisp Language! 3. Write a function in the manner (defun split (sent punc).) for splitting the given list, 'sent',

 Coding must be done in the Lisp Language! 3. Write afunction in the manner (defun split (sent punc).) for splitting the given

Coding must be done in the Lisp Language!

3. Write a function in the manner (defun split (sent punc).) for splitting the given list, 'sent', into two lists, one consisting of the elements before the first occurrence of the atom 'punc' (as a top-level list element), and the other consisting of the elements after the first occurrence of 'punc', preserving the ordering of the elements. If 'sent' is not a list or 'punc' is not an atom, print an error message and return NIL. If 'sent and 'punc' are of the required type but 'sent' does not contain a top-level occurrence of 'punc, return 'sent' unchanged. For example, (split '(Hi there . How are you ?) .) --> ((HI THERE) (HOW ARE YOU?)) (spt it | (Hi, the re \. How are you ?) '?) ==> ((HI THERE \. HOW ARE YOU ) ( )) (split ((Hi there) ( (How are you?))'(.)) > Error: The 2nd arg of 'split', (1.). is not an atom NIL (split ' ((Hi there) (\') (How are you? ) ) '\.) ==> ((HI THERE) (\.) (HOW ARE YOU?)) 3. Write a function in the manner (defun split (sent punc).) for splitting the given list, 'sent', into two lists, one consisting of the elements before the first occurrence of the atom 'punc' (as a top-level list element), and the other consisting of the elements after the first occurrence of 'punc', preserving the ordering of the elements. If 'sent' is not a list or 'punc' is not an atom, print an error message and return NIL. If 'sent and 'punc' are of the required type but 'sent' does not contain a top-level occurrence of 'punc, return 'sent' unchanged. For example, (split '(Hi there . How are you ?) .) --> ((HI THERE) (HOW ARE YOU?)) (spt it | (Hi, the re \. How are you ?) '?) ==> ((HI THERE \. HOW ARE YOU ) ( )) (split ((Hi there) ( (How are you?))'(.)) > Error: The 2nd arg of 'split', (1.). is not an atom NIL (split ' ((Hi there) (\') (How are you? ) ) '\.) ==> ((HI THERE) (\.) (HOW ARE YOU?))

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!