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

Function support? #95

Closed
JacobNeumann88 opened this issue Jan 12, 2022 · 1 comment
Closed

Function support? #95

JacobNeumann88 opened this issue Jan 12, 2022 · 1 comment

Comments

@JacobNeumann88
Copy link

JacobNeumann88 commented Jan 12, 2022

When using pyJulia if I need to write a function for julia I can write it as a string and pass it to Main.eval(). When I take a similar approach using juliaCall it simply returns a string instead of a julia function. Is there some module or command that I am missing or is this conversion not supported?
As a side note when I attempt to load a custom module using "import juliacall; jl = juliacall.newmodule('newMod')" nothing loads. I tested it using julia native modes and it loaded just fine. Are custom modules not supported?

@cjdoris
Copy link
Collaborator

cjdoris commented Jan 12, 2022

For the first part, there is Main.seval(...) which parses a string then evaluates it. Main.eval is just the eval function from Julia which indeed just returns a string unchanged.

For the second part, I don't know what you mean. newmodule simply creates a new empty module. No code loading happens. To load a module use jl.seval("using Example").

@cjdoris cjdoris closed this as completed Jan 24, 2022
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