Compile def using top variable and setter function