Skip to content

mechanism for obtaining local variable names and values #29366

@JeffBezanson

Description

@JeffBezanson

It could be useful for debugging to be able to easily get the names and values of all variables in scope, e.g. so you don't have to manually write them all in a call to @show. This could be provided as a macro @locals (though needs to be implemented specially in lowering, since the set of variables in scope is not available during macro expansion), returning a dictionary, similar to locals() in python: https://docs.python.org/3/library/functions.html#locals

Thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    compiler:loweringSyntax lowering (compiler front end, 2nd stage)featureIndicates new feature / enhancement requests

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions