Re: When to use .new?

2022-12-07 Thread ToddAndMargo via perl6-users
On 12/5/22 11:19, Ralph Mellor wrote: 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

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
ot;literal" form for `Pointer`s? I doubt it. But if you wanted to explore that, Raku makes it possible. > Is there some rule I can follow that let me know when I have to > use `.new and when I do not? About the only rule there can be for arbitrary Raku code is whether you already

When to use .new?

2022-11-30 Thread ToddAndMargo via perl6-users
Hi All, 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(); Is there some rule I can follow that let me know when I have to use .new and when I do not? (I am getting tired of figur