Use a function to compile