It is tracking the dynamic scope of the code generator, it doesn't care 
about what code you emit. The generator function must not cause any 
side-effects and must be entirely computed from the types of the inputs and 
not other global state. Over time, these conditions are likely to be more 
accurately enforced, as needed to make various optimizations reliable 
and/or correct.



On Wednesday, August 10, 2016 at 10:48:31 AM UTC-4, Erik Schnetter wrote:
>
> I'm encountering the error "eval cannot be used in a generated function" 
> in Julia 0.5 for code that is working in Julia 0.4. My question is -- what 
> exactly is now disallowed? For example, if a generated function `f` calls 
> another (non-generated) function `g`, can `g` then call `eval`? Does the 
> word "in" here refer to the code that is generated by the generated 
> function, or does it refer to the dynamical scope of the code generation 
> state of the generated function?
>
> To avoid the error I have to redesign my code, and I'd like to know ahead 
> of time what to avoid. A Google search only turned up the C file within 
> Julia that emits the respective error message, as well as the Travis build 
> log for my package.
>
> -erik
>
> -- 
> Erik Schnetter <schnet...@gmail.com> 
> http://www.perimeterinstitute.ca/personal/eschnetter/
>

Reply via email to