Error message "UndefVarError: Execution not defined"
Closed this issue · 3 comments
Hello,
When I try to run my_wrap() below with the execDetails function syntax from your source code I get an error message from Julia:
UndefVarError: Execution not defined
All other functions in the Jib.Wrapper( ) are fine.
Is there a way around this?
Thank you in advance for the help.
Regards,
function my_wrap( )
...
wrap = Jib.Wrapper(
... some functions (ok)
execDetails = function(reqId::Int, contract::Contract, execution::Execution)
d[:ex_con] = contract
d[:execution] = execution
println("ExecDetails: $reqId")
end,
... more functions (ok)
end # wrap
...
end # my_wrap()
In general, this package doesn't export any name.
In order to use any function or type defined therein you can either:
- fully qualify the name by adding the prefix
Jib.
, or - add in your file
using Jib: name
So in your case you can either use Jib.Execution
or add using Jib: Execution
somewhere earlier in the file.
There's also a third option: in fact in Julia there's really no benefit in using type annotations in function definitions.
This is equally fine:
execDetails = function(reqId, contract, execution)
d[:ex_con] = contract
d[:execution] = execution
println("ExecDetails: $reqId")
end
I used the third option mentioned above. Works very well indeed.
My issue is solved.
Thank you very much.