Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow defining custom builtins #423

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

edison-moreland
Copy link

@edison-moreland edison-moreland 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
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.

None yet

2 participants