[Gambas-devel] Problems in gb.gsl

Benoît Minisini gambas at ...1...
Sat Feb 18 14:18:31 CET 2012


Here is a list of what I have detected (I may have missed some things!)

1) You cannot use 'Pointer' to implement the Complex.Frexp method. You 
must do differently. Maybe by returning a Variant[] with a Float and an 
Integer. Gambas cannot return more than one value.

2) gsl_frexp has nothing to do with complex numbers. So why do you put 
it in the Complex class?

3) Arguments must be named the "Pascal" way: so you must write (X) in 
the signature, not (x).

4) "static GSLCOMPLEX *create_complex();" written in c_complex.h is a 
mistake. "static" means that the create_complex() function is private to 
the c_complex.c file. If you need to use create_complex() outside of 
c_complex.c, you must remove the 'static' keyword, and then you can 
declare it in the header file. Moreover, you will have to rename it so 
that we know that it is not static anymore: something like 
'COMPLEX_create' (this is the convention I use).

5) You must update all your source file top commentaty with the true 
file name.

6) GB.NewArray() and its fellows will help you to implement the 
Polynomial class: you just have to keep a 'double *' pointer, and these 
functions will do everything for you: allocating, freeing, increasing 
the array size, shrinking it. The 'len' field I put in the CPOLYNOMIAL 
structure is actually not needed, as GB.Count() returns the size of the 
array.

Regards,

-- 
Benoît Minisini




More information about the Devel mailing list