Write a function filter-tail! which when given a list X and predicate P filters out all elements of the tail of X for which P evaluates to #f by destructively updating the list. (The function may return any value and should ignore the case when X is empty.) For example:
==> (define x (list 1 2 3 4 5 6 7 8 9 10)) ==> (filter-tail! even? x)) ==> x (1 2 4 6 8 10)