Skip to content

Remove remaining eval call in the @defcomp #760

@davidanthoff

Description

@davidanthoff

I think we should be able to get rid of the remaining eval call in defcomp as well, here.

I think all we would have to do is move the check that is there into add_parameter here so that it doesn't occur during macro expand time but rather when the code that is generated by the macro actually runs. And then in the AST we just use the same strategy that we now used for the types, i.e. we just put the expression into the AST instead of the evaled expression.

That should in general all be way more stable that way, because a) the expression for the default value will then be evaluated in the module where it is written down and b) in general it shouldn't be necessary (or advised) to call eval inside a macro.

@lrennels ok if I assign this to you as a follow up of the previous one?

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions