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

Bruno Félix Rezende Ribeiro oitofelix at ...181...
Thu May 8 16:39:32 CEST 2014


Em Thu, 08 May 2014 14:25:33 +0200
Benoît Minisini <gambas at ...1...> escreveu:

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

This problem arose when I tried to use some bit manipulation functions
over pointers and get caught by an error.  The very simple code below
show what I mean:

  Dim pPointer As Pointer = BSet(pPointer, 2)

The evaluation of the previous line raises an error which says:

  "Type mismatch: wanted Number, got Pointer instead"

However I can obtain the desired behavior by rewriting it as:

  Dim pPointer As Pointer = BSet(CLong(pPointer), 2)

My request is to make the interpreter operate directly over pointers
within numeric functions or to convert Pointers to Longs transparently
whenever needed.  Considering the error message, I think the
interpreter should consider the type 'Pointer' a "Number type" also.


Thank you for your dedication.


Ps: I'm using Gambas 3.5.2.

--
 ,= ,-_-. =.  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;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20140508/4a351908/attachment.sig>


More information about the User mailing list