-
-
Notifications
You must be signed in to change notification settings - Fork 90
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 def symbols when using :allow whitelist with sci.core/init #434
Comments
I don't think anyone will have a problem with this and we can update accordingly. Sci vars have Possibly related: #357 |
Wow, thanks! I'm using Clojars, so I'd love to see a new release.
Would allowing |
Will be available as |
I can confirm that I get the desired behavior on |
Is your feature request related to a problem? Please describe.
I'd like to use an
:allow
whitelist forsci.core/init
, but also allow todef
arbitrary symbols.Describe the solution you'd like
I can whitelist symbols to be used in evaluation:
but I'd have manually allow each symbol bound with def:
With
let
, arbitrary symbols are allowed:Describe alternatives you've considered
Possible solutions
Changing :allow semantics to allow the user to define own symbols. Backwards-incompatible, possibly not desirable.
Add new option to sci.core/init. Example:
(sci.core/init {:allow '[def + -] :allow-def-symbols true)
.defn
,def
anddefmacro
be treated with one option, or should they be possible to control individually?My usecase specifically
I'm building a language on top of Sci. I'd like to use the whitelist to be explicit about what subset of Sci I'm using. However, I need to support binding variables.
One option is to rewrite my code to a let. But then I would not have intermediate variables available in ctx after running.
Thanks for a great project!
The text was updated successfully, but these errors were encountered: