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

How to pass native Java callbacks like in Python's Jsonnet binding #102

Closed
bankotsu opened this issue Nov 13, 2020 · 1 comment
Closed

Comments

@bankotsu
Copy link

When sjsonnet is used from Java or as a standalone executable assembly, is there a way to inject native Java functionality (such as Pattern.quote()) to the jsonnet evaluator? i want to be able to execute simple Java code from within the jsonnet/sjsonnet code as can be performed with Python's jsonnet bindings using the evaluate_file function and passing the native_callbacks argument, and being able to invoke these callbacks using std.native(...) from within the jsonnet file.

image

@lihaoyi-databricks
Copy link
Contributor

Since #166 merged, we should be able to pass in callbacks through the Scala API whether you are using sjsonnet.SjsonnetMain.main0 or sjsonnet.Interpreter. This problem then reduces to needing to provide an idiomatic Java API, which we can track as part of #157

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

No branches or pull requests

2 participants