Improve defop macro to take type specifications.