Compile def with local variables