Skip to content

Make macros very careful about what they expect to be in scope #320

@oxinabox

Description

@oxinabox

Follow up to #318 about doing it the right way. (rather than just enough to fix the symptom)

From #317 @devmotion said:

but IMO it is the wrong fix. Instead one should apply esc only locally, wherever needed: currently definitions such as @non_differentiable Base.length(kwargs::AbstractVector) or @non_differentiable Base.length(rrule::AbstractVector) will lead to multiple arguments of the same name in the rrule and frule definitions.

@simeonschaub said in #319 (comment)_

This will still fail if one only does using ChainRulesCore: @scalar_rule. I think it would be better to just interpolate rrule directly into the AST.

We should do this.
and we should text it via addign to the isolated test modules just using ChainRulesCore: @scalar_rule, @non_differentiable
which brings as little into scope as possible

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingrule definition helperrelating to helpers for declaring rules

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions