Skip to content

Allow defining custom builtins#423

Open
superb-eddie wants to merge 1 commit into
d5:masterfrom
superb-eddie:custom_builtins
Open

Allow defining custom builtins#423
superb-eddie wants to merge 1 commit into
d5:masterfrom
superb-eddie:custom_builtins

Conversation

@superb-eddie
Copy link
Copy Markdown

@superb-eddie superb-eddie commented Jun 23, 2023

This is a feature I've found very helpful in my project, SceneEngine.

For my use case, I've got custom user scripts being imported by a runtime script and I need to expose custom builtin functions to that userscript.
I tried creating the builtin as globals, but globals aren't exposed to libraries when they're imported.

Copy link
Copy Markdown
Collaborator

@geseq geseq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR. I like the idea for this but I'm not keen on breaking the NewVM call for current users for what is likely to be a rarer use case.

Can we instead introduce functional options to pass in the builtins. That way the code remains unbroken for all current users and will also allow future introductions of more options while remaining backwards compatible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants