Re: pointer confusion

2022-12-05 Thread Ralph Mellor
On Mon, Dec 5, 2022 at 10:20 PM ToddAndMargo via perl6-users wrote: > > > use NativeCall; > > my Pointer $foo .= new: 42; > > say $foo; # NativeCall::Types::Pointer<0x2a> > > print $foo; # NativeCall::Types::Pointer<5895604297984> `say` concatenates the `.gist`s of each of its arguments.

Re: pointer confusion

2022-12-05 Thread ToddAndMargo via perl6-users
On 12/5/22 09:25, Ralph Mellor wrote: On Sat, Dec 3, 2022 at 11:44 AM ToddAndMargo via perl6-users wrote: I am confused I think the following is a golf of your confusion: ``` use NativeCall; my Pointer $foo .= new: 42; say $foo; # NativeCall::Types::Pointer<0x2a> print $foo; #

Re: Session ID

2022-12-05 Thread ToddAndMargo via perl6-users
On 12/5/22 09:17, Ralph Mellor wrote: On Mon, Dec 5, 2022 at 9:45 AM ToddAndMargo via perl6-users wrote: Answer 3: https://stackoverflow.com/questions/74665162/how-do-i-assign-the-value-in-carray-that-contains-a-memory-address-to-a-poi#74674303 Håkon Hægland is astonishing good at this

Re: When to use .new?

2022-12-05 Thread Ralph Mellor
I forgot to mention one other shortcut that is always available if you do have to use `.new` (which is the case for most types). You can write: ``` my $foo = 42; ``` The `42` on the RHS of the `=` is the shortest way to create an integer value corresponding to `42`. But you could also write: ```

Re: When to use .new?

2022-12-05 Thread Ralph Mellor
On Thu, Dec 1, 2022 at 4:28 AM ToddAndMargo via perl6-users wrote: > > Why can I get away with `my Str $x = "";` > > But I have to use .new here (an other places too) `my $ppSession = > NativeCall::Types::Pointer.new();` There are ways to write the value of some data types with minimum fuss.

Re: pointer confusion

2022-12-05 Thread Ralph Mellor
On Sat, Dec 3, 2022 at 11:44 AM ToddAndMargo via perl6-users wrote: > > I am confused I think the following is a golf of your confusion: ``` use NativeCall; my Pointer $foo .= new: 42; say $foo; # NativeCall::Types::Pointer<0x2a> print $foo; # NativeCall::Types::Pointer<5895604297984> ``` I

Re: Session ID

2022-12-05 Thread Ralph Mellor
On Mon, Dec 5, 2022 at 9:45 AM ToddAndMargo via perl6-users wrote: > > Answer 3: > https://stackoverflow.com/questions/74665162/how-do-i-assign-the-value-in-carray-that-contains-a-memory-address-to-a-poi#74674303 > > Håkon Hægland is astonishing good at this stuff. Indeed he is! If one of his

Re: Session ID

2022-12-05 Thread ToddAndMargo via perl6-users
On 11/14/22 12:54, ToddAndMargo via perl6-users wrote: Hi All, Windows 11 22H2 Is there a way to find session ID of the current running program?  Any predefined system variable for that? Many thanks, -T Answer 3: