Hi!
congratulations for the Julia language, it's a great idea :-)
I'm learning Julia and I'm trying to write a libpq (PostgreSQL) wrapper. Executing this (julia version 0.3.0-744~ubuntu13.10.1):
module LibPQ
typealias PGconn Ptr{Void}
function pgconn_finalizer(x::PGconn)
ccall( (:PQfinish, "libpq"), Void, (PGconn,), x )
println("finalized")
end
c = ccall( (:PQconnectdb, "libpq"), PGconn, (Ptr{Uint8},), "connection params" )
finalizer(c, pgconn_finalizer)
println(c)
gc()
end
I get an error:
$ julia libpq.jl
ERROR: objects of type Ptr{None} cannot be finalized
in finalizer at base.jl:103
in include at boot.jl:240
while loading ./libpq.jl, in expression starting on line 12
I guess I have to change the PGconn type alias from Ptr{Void} to something, but I am undecided about what to use.