risor-io / risor

Fast and flexible scripting for Go developers and DevOps.
https://risor.io
Apache License 2.0
581 stars 24 forks source link

New Risor options: WithoutGlobal, WithoutGlobals, WithGlobalOverride #151

Closed myzie closed 6 months ago

myzie commented 6 months ago

cc @luisdavim

myzie commented 6 months ago

@luisdavim - how does this look?

I could've added to your PR but I started this as an experiment and I didn't want to step on your work without running my changes by you.

luisdavim commented 6 months ago

@luisdavim - how does this look?

I could've added to your PR but I started this as an experiment and I didn't want to step on your work without running my changes by you.

Yeah, no worries 👍 .

This LGTM but I'm not sure if allowing overriding module properties through SetAttr is the best option, I can see pros and cons, I had thought about that but ended up creating the separate Override method for it. Up to you, just something to think about....

myzie commented 6 months ago

@luisdavim - I added Override back. LMK if there's anything off. But I merged already since it seems like this should do it for you.