circular reference check and basic anonymous function support