i've been given an assignment

"define function filter which will act like filter on a list"
which is pretty easy, this is it

(define (my_filter p? list)
  (if(null? list) 
    (if(p? (car list))
       (cons (car list) (my_filter p? (cdr list)))
       (my_filter p? (cdr list))
but the second part says "do so using functions map, append and apply" and i really don't understand how he wants me to define filter using those functions

the closest i got was mapping the list and returning either empty list or the original element, but that still leaves the empty lists instead of "nothing"