kurtlawrence / papyrus

(Rust) repl
MIT License
439 stars 14 forks source link

procedural macro to inject variables #104

Open Mic92 opened 3 years ago

Mic92 commented 3 years ago

I saw in your examples, that it's possible to inject local variables through app_data. Do you think it's feasible to inject a struct with reference to the current function scope into the repl? In this tutorial I saw a trace_vars macro that went in a similar direction: https://blog.logrocket.com/macros-in-rust-a-tutorial-with-examples/ I think there might be issues with ownership?

This would make papyrus super useful for debugging and add feature similar to binding.pry in ruby or breakpoint() in python.