initializing Pointer

[email protected] (Marcel Timmerman)
Newsgroups perl.perl6.users
Message-ID <[email protected]>
Hi,

I would like to initialize a Pointer with some value but get an error. 
For example;

my $a = Pointer[Str].new('text');

The error thrown:

Default constructor for 'NativeCall::Types::Pointer[Str]' only takes 
named arguments

The way I can do it now is by creating a CArray and then do a nativecast 
which is a bit cumbersome.
The reason I would like to use Pointers is when there is only one object 
to point to, not an array. Secondly, for the use of the deref() function 
to get the value it points to.

Is there another way to solve this or is it a bug in the 
NativeCall::Types module. I have noticed that there  are 3 new() methods 
defined accepting positional arguments.

Regards,
Marcel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.