[Gambas-user] Feature request: Make 'Pointer' a true integer type

Benoît Minisini gambas at ...1...
Thu May 8 14:25:33 CEST 2014


Le 27/04/2014 10:14, Bruno Félix Rezende Ribeiro a écrit :
> 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.
>

Pointer are already automatically converted to integers or longs. What 
do you need to do exactly?

-- 
Benoît Minisini




More information about the User mailing list