Front page | perl.perl6.users |
Postings from November 2022
Re: What is this "\t"?
Thread Previous
|
Thread Next
From:
Marcel Timmerman
Date:
November 29, 2022 14:15
Subject:
Re: What is this "\t"?
Message ID:
5900574f-b8a7-0ee6-c398-4edd20945292@gmail.com
On 29-11-2022 15:08, Elizabeth Mattijsen wrote:
> Perhaps it would make sense to export these to a separate
> Gnome::Constants module?
Wel, I have done that, sort of. The file is generated in the Build phase
of the installation of Gnome::N where I run a C program outputting the
sizes from several C macro definitions. The other types are fixed, like
gboolean and just added to the list. The file is called
Gnome::N::GlibToRakuTypes.
>
>> On 29 Nov 2022, at 15:05, Marcel Timmerman <mt1957@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(>k-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 ….
>>
Thread Previous
|
Thread Next