Re: [julia-users] How to check whether a values is nothing using the Julia C API?

2014-03-10 Thread Felipe Cruz
Hi All! I started another project to integrate Python and Julia, but instead of using Python ctypes, I'm using Python cffi: https://github.com/felipecruz/pyju I found cffi much better than ctypes, plus, it brings PyPy compatibility. There's already some code working but, so far, I needed to

Re: [julia-users] How to check whether a values is nothing using the Julia C API?

2014-03-10 Thread Felipe Cruz
I'm sorry. add julia/src dir to cffi include dir, because *options.h* it's not exported so JULIA_DIR/include/julia Segunda-feira, 10 de Março de 2014 11:49:29 UTC-3, Felipe Cruz escreveu: Hi All! I started another project to integrate Python and Julia, but instead of using Python ctypes,

Re: [julia-users] How to check whether a values is nothing using the Julia C API?

2014-03-10 Thread Steven G. Johnson
On Sunday, March 9, 2014 10:20:23 PM UTC-4, Kenta Sato wrote: I know that pyjulia exists, but I didn't try it. The core idea of pyjulia seems to be incorporated into IJulia, but they does not share the source code. I'm going to investigate the functionality of PyCall.jl. pyjulia and

[julia-users] How to check whether a values is nothing using the Julia C API?

2014-03-09 Thread Kenta Sato
Hi, I'm new to the Julia language, and I'm now trying the Julia C API in order to call Julia functions from Python. I've become successful with calling some basic Julia functions such as (*) and sqrt() and converting the returned values to corresponding ones in Python. But I've got into a

Re: [julia-users] How to check whether a values is nothing using the Julia C API?

2014-03-09 Thread Stefan Karpinski
There is a unique instance of the Nothing type called `nothing`. In C, `jl_nothing` is a pointer to that value. Since the instance is unique, you can just check pointer equality: `v == jl_nothing`. The reason you get a linking error for jl_is_null is that it is a macro: src/julia.h 490:#define

Re: [julia-users] How to check whether a values is nothing using the Julia C API?

2014-03-09 Thread Stefan Karpinski
+1e99 to using starting with Jake's pyjulia instead of duplicating this effort. It's much better for there to be one really great way to call Julia from Python than many less good ways. That said, I've felt for some time that this functionality really needs an owner – someone to turn it into a

Re: [julia-users] How to check whether a values is nothing using the Julia C API?

2014-03-09 Thread Kenta Sato
Thank you for your reply. I know that pyjulia exists, but I didn't try it. The core idea of pyjulia seems to be incorporated into IJulia, but they does not share the source code. I'm going to investigate the functionality of PyCall.jl. Thanks again! On Monday, March 10, 2014 2:05:42 AM UTC+9,