>
> Sorry but I am not sure what you mean and how to "*evaluate your .jl file
> defining the module first*"?
Ok, say you have a file:
```
module mymod
function foo() ... end
end
```
At the Julia prompt you would do:
julia> include("myfile.jl")
And then you have the module `mymod` available in the global namespace. In
C you can do the equivalent with:
`jl_load("myfile.jl")`
I am really new to Julia so maybe the question sounds really stupid, sorry
> for that
No problem, no stupid questions. However, I would suggest that you might
want to spend some time getting really familiar with Julia by itself,
before trying to use the embedding API. It might save a lot of time in the
long run.
On Tue, Jun 30, 2015 at 10:54 AM, Kostas Tavlaridis-Gyparakis <
[email protected]> wrote:
> Sorry but I am not sure what you mean and how to "*evaluate your .jl file
> defining the module first*"?
> (I am really new to Julia so maybe the question sounds really stupid,
> sorry for that)
>
>
>
>
>
> On Tuesday, June 30, 2015 at 4:28:54 PM UTC+2, Isaiah wrote:
>>
>> `jl_new_module` creates a new module. You must evaluate your .jl file
>> defining the module first, then to get a reference to the module do:
>>
>> `jl_value_t* mod = jl_eval_string("MyModName");
>>
>> Then you can pass "mod" as the argument to `jl_get_function`.
>>
>> On Tue, Jun 30, 2015 at 10:16 AM, Kostas Tavlaridis-Gyparakis <
>> [email protected]> wrote:
>>
>>> Hello,
>>> I am trying to write some function in Julia which I will be able to call
>>> inside my C++ projects in Eclipse.
>>> In the documentation there is this
>>> <http://julia-demo.readthedocs.org/en/latest/manual/embedding.html#calling-julia-functions>
>>> example on how to call a function of julia from an existing module.
>>> So, what I have done was to create my own module where inside I included
>>> my function and then my
>>> understanding is that I should be using "jl_new_module(jl_sym_t *name);"
>>> instead of jl_base_module.
>>> But I am not sure (in case my assumption that this is the correct
>>> command is true) how to proper use
>>> it's syntax, as what I am trying is:
>>>
>>> jl_function_t * func =
>>> jl_get_function(jl_new_module(mymodule),"myfunction");
>>>
>>> and I tried instead of mymodule also mymodule.jl and "mymodule" and
>>> "mymodule.jl" and in all the attempts I
>>> recieve an error that:
>>>
>>> mymodule was not declared in this scope
>>>
>>>
>>> Let me note beforehand that the module is being stored globaly as when I
>>> run julia on the terminal I can use it
>>> through the comand using mymodule.
>>> Still maybe I am trying to use the wrong command or sth, so if there is any
>>> suggestion I would be really greatful
>>> to hear it.
>>>
>>>
>>>
>>>
>>