The usual way to delete a function – any entity, for that matter, is
delete entity from namespace
delete foo from `.
However, .z is a special namespace, so delete doesn’t work:
q)delete ts from `.z
There is a special command just for removing elements from .z:
See \x (expunge).