Converted spy-first, spy-last, and spy-val from macro -> function