Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

What is this "\t"?

4 views
Skip to first unread message

ToddAndMargo via perl6-users

unread,
Nov 27, 2022, 9:00:05 PM11/27/22
to perl6-users
Hi All,

On

https://github.com/salortiz/NativeHelpers-Blob/blob/master/lib/NativeHelpers/Blob.pm6

Line 96

my \t = ptr.of ~~ void ?? $type.of !! ptr.of;


What is `\t`?

What of `.of`

What is `??`?

What is `!!`


Yours in confusion.

-T

ToddAndMargo via perl6-users

unread,
Nov 28, 2022, 9:30:09 PM11/28/22
to perl6...@perl.org
On 11/28/22 17:40, ToddAndMargo wrote:
> Sigilless variable
> https://docs.raku.org/language/glossary#Sigilless_variable
>
>      Sigilless variables are actually aliases to the
>      value it is assigned to them, since they are
>      not containers. Once you assign a sigilless
>      variable (using the escape \), its value cannot
>      be changed.


Not to beat a dead horse, but when does that stop me!

"\" escape to a beginner means to escape the
following character

> say "\$x"
$x

> print '\\abc\:\:' ~ "\n"
\abc\:\:

So without a proper sigil explanation for
beginners, "using the escape \" means nothing.



ToddAndMargo via perl6-users

unread,
Nov 29, 2022, 7:15:03 AM11/29/22
to perl6...@perl.org
On 11/29/22 01:13, Francis Grizzly Smit wrote:
> Personally I never use \name are I hate how it looks, and so far I have
> never needed it, so unless I can find something it can do that I cannot
> do any other way, I'll keep on not using it


I have seen it use and it was sneaky as all heck.
Very clever.

But I am with you. I want everything declared
so I don't get lost in the mire.


Elizabeth Mattijsen

unread,
Nov 29, 2022, 9:15:04 AM11/29/22
to perl6...@perl.org
Perhaps it would make sense to export these to a separate Gnome::Constants module?

> On 29 Nov 2022, at 15:05, Marcel Timmerman <mt1...@gmail.com> wrote:
>
> On 29-11-2022 10:13, Francis Grizzly Smit wrote:
>
> Hi Francis,
>>
>> Personally I never use \name are I hate how it looks, and so far I have never needed it, so unless I can find something it can do that I cannot do any other way, I'll keep on not using it
>>
> To show an example where I could use it I have defined a series of types in the Gnome packages of mine and could then use it everywhere as a type. The glib has several types defined which I wanted to use in my code so that I can cut and paste the code from the C source into Raku source without much changes.
>
> There is a file defined in Gnome::N where a list of types is defined
> …
> constant \gboolean is export = int32;
> constant \gchar is export = int8;
> constant \gdouble is export = num64;
> constant \gfloat is export = num32;
> constant \gint is export = int32;
> …
>
>
> And later in other modules I could then use these definitions, here for example 'gint'.
>
> …
> sub gtk_widget_add_events (
> N-GObject $widget, gint $events
> ) is native(&gtk-lib)
> { * }
> …
>
> The types file is generated to cope with int sizes differing on several implementations. E.g. a long int could be 32 or 64 bits depending on the implementation or OS or chip or ….
>

0 new messages