Pre-defined Win32 API aliases for bits types such as
const BYTE = Cuchar
const BOOL = Cint
const BOOLEAN = BYTE
const DOUBLE = Cdouble
const DWORD = Culong
seem mostly uncontroversial and straight forward.
But what about aliases for pointer types, such as
const PDWORD = Ptr{DWORD}
const LPDWORD = Ptr{DWORD}
Should these really be Ptr{} or Ref{}?
Or should they remain undefined, to force the user to think about that difference for each use case themselves? In other words, should the user not write Ptr{HANDLE} or Ref{HANDLE} instead of PHANDLE?
Or should bits aliases, Ptr{} aliases and Ref{} aliases all go into separate modules or submodules, so that the Ptr{} vs Ref{} choice can be made by the user at import time?
Could the documentation for these types provide some more guidance on pointers?
(I don't have any answers yet; I just wanted to open an issue to collect thoughts on the subject.)
See also When to use T, Ptr{T} and Ref{T}
Pre-defined Win32 API aliases for bits types such as
seem mostly uncontroversial and straight forward.
But what about aliases for pointer types, such as
Should these really be
Ptr{}orRef{}?Or should they remain undefined, to force the user to think about that difference for each use case themselves? In other words, should the user not write
Ptr{HANDLE}orRef{HANDLE}instead ofPHANDLE?Or should bits aliases,
Ptr{}aliases andRef{}aliases all go into separate modules or submodules, so that thePtr{}vsRef{}choice can be made by the user at import time?Could the documentation for these types provide some more guidance on pointers?
(I don't have any answers yet; I just wanted to open an issue to collect thoughts on the subject.)
See also When to use T, Ptr{T} and Ref{T}