improved syntax of a macro
defined trans function for field assignment