Hello again!

It'd be very handy if 'Pointer' was considered by the interpreter as an
integer data type like 'Byte', 'Short', 'Integer' and 'Long'. That way
one could use any integer function indiscriminately on a Pointer as
well, rather than converting it to 'Long' (using 'CLong' function)
every time it's an argument for an integer function.  That is specially
relevant when interfacing with external C libraries, where to make
portable Gambas programs one need to treat the C data type 'long' as
the Gambas data type 'Pointer'.  This means that 'Pointer' isn't
meaningful only in pointer contexts but also in ordinary integer
contexts.  What do you think about this proposed change?  Is there any
way in which it can be harmful to existing code or interpreter's
functionality?

Thanks in advance.

Ps: In order to make portable Gambas programs which interface with
external C libraries, one needs to follow the correct equivalence
between C and Gambas integer data types, which is given by the table:

[C]             [Gambas]
char            Byte
short           Short
int             Integer
long            Pointer
void *          Pointer
long long       Long

However, the Gambas Wiki page [1], besides having an incomplete table
which does not address 'char', 'short' and 'long long', says that the
equivalent of C's 'long' is Gambas' 'Long', what is only true on some
64-bit architectures.

Footnotes:

[1] http://gambaswiki.org/wiki/howto/extern

-- 
 ,= ,-_-. =.  Bruno Félix Rezende Ribeiro (oitofelix) [0x28D618AF]
((_/)o o(\_)) There is no system but GNU;
 `-'(. .)`-'  GNU Linux-Libre is one of its official kernels;
     \_/      All software must be free as in freedom;

Attachment: signature.asc
Description: PGP signature

------------------------------------------------------------------------------
Start Your Social Network Today - Download eXo Platform
Build your Enterprise Intranet with eXo Platform Software
Java Based Open Source Intranet - Social, Extensible, Cloud Ready
Get Started Now And Turn Your Intranet Into A Collaboration Platform
http://p.sf.net/sfu/ExoPlatform
_______________________________________________
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user

Reply via email to