crystal-lang / crystal_lib

Automatic binding generator for native libraries in Crystal
138 stars 30 forks source link

Overlapping function names: ignores case #11

Open aladagemre opened 8 years ago

aladagemre commented 8 years ago

I'm trying to generate wrapper for igraph. Here is one case that is missed: when function names are the same when turned into lowercase.

A function name ending with a lowercase D:

fun revolver_ml_d = igraph_revolver_ml_d(graph : T*, niter : IntegerT, kernel : VectorT*, cites : VectorT*, delta : RealT, filter : VectorT*, logprob : RealT*, logmax : RealT*) : LibC::Int

And the function name with a uppercase D:

fun revolver_ml_d = igraph_revolver_ml_D(graph : T*, res : VectorT*, fmin : RealT*, abstol : RealT, reltol : RealT, maxit : LibC::Int, a_fun : VectorT*, VectorT*, Void* -> RealT, d_a_fun : VectorT*, VectorT*, VectorT*, Void* -> Void, filter : VectorT*, fncount : IntegerT*, grcount : IntegerT*) : LibC::Int

Then it gives error when I try to use it, saying you redefined.

aladagemre commented 8 years ago

https://github.com/aladagemre/crystal-igraph/blob/0ce58a79bdeab565af3dca6e19bcfbf2285b9b9c/lib_igraph.cr

asterite commented 8 years ago

Good find. I'll try to think of a solution. Maybe always using downcase for the names is not good.

bew commented 8 years ago

@asterite did you conclude on something?