For the sake of readability you might want use a subset:
https://docs.raku.org/language/typesystem#subset
On Thu, 9 Jan 2020 at 08:13, WFB wrote:
> Hi, Todd,
>
> If I understand your question right, then you mean something like that:
>
> sub do-soemthing($value where { .WHAT ~~ Str || .WHAT ~~
Hi, Todd,
If I understand your question right, then you mean something like that:
sub do-soemthing($value where { .WHAT ~~ Str || .WHAT ~~ Int }) {}
https://docs.raku.org/type/Signature#index-entry-where_clause
Regards
On Thu, 9 Jan 2020 at 03:58, ToddAndMargo via perl6-users <
Hi Todd,
dd or .WHAT will give you that information.
dd $i;
say $i.WHAT;
Greetings
On Thu, 9 Jan 2020 at 03:58, ToddAndMargo via perl6-users <
perl6-users@perl.org> wrote:
> Hi All,
>
> Is there a way to ask a variable what "type" it is?
>
> Many thanks,
> -T
>
Which is what I told you twice as an answer to your question:
https://stackoverflow.com/questions/59630605/does-rakus-nativecall-run-localfree.
Also, documentation:
https://docs.raku.org/language/nativecall#index-entry-nativecall
"Call into dynamic libraries that follow the C calling convention"
On 2020-01-08 22:03, ToddAndMargo via perl6-users wrote:
On 2020-01-08 21:05, ToddAndMargo via perl6-users wrote:
Hi All,
Does Raku's NativeCall run WinAPI's "LocalFree( )" after it creates
buffers? Or do I need to do it myself?
On 2020-01-08 21:05, ToddAndMargo via perl6-users wrote:
Hi All,
Does Raku's NativeCall run WinAPI's "LocalFree( )" after it creates
buffers? Or do I need to do it myself?
https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-localfree
Many thanks,
-T
I am doing it
On 2019-12-30 00:28, ToddAndMargo via perl6-users wrote:
Hi All,
In the following C code
DWORD FormatMessageW(
DWORD dwFlags,
LPCVOID lpSource,
DWORD dwMessageId,
DWORD dwLanguageId,
LPTSTR lpBuffer,
DWORD nSize,
Hi All,
I have RegSetValueExW working now. It even
creates keys when they don't exist.
I have to catch up on other project for customers
(and refill the coffers) that have been put on
hold to get these modules programmed, so it will
be at least a month away before I can get them
up on GIT or
Hi All,
Does Raku's NativeCall run WinAPI's "LocalFree( )" after it creates
buffers? Or do I need to do it myself?
https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-localfree
Many thanks,
-T
Hi All,
Is there a way to ask a variable what "type" it is?
Many thanks,
-T
Hi All,
In a sub declaration, is there a way to constrain
a variable to only an "int32" or a "Str" (I want both)?
Or do I have to put up with the other types of "Any"?
Many thanks,
-T
Hi All,
I have been writing a technical specification for a
customer. I had to do a bunch of conversions from
hex to decimal and minutes to seconds. I have a
calculator for this, but I had REPL open so
I tried it and it easier to use!
70 minutes x 60 seconds in hex:
> say (60 * 70).base(16)
On 2020-01-07 08:20, ToddAndMargo via perl6-users wrote:
On 2020-01-06 22:54, ToddAndMargo via perl6-users wrote:
Hi All,
What am I doing wrong here?
> my int16 $x = 0xABCD;
-21555
> say $x.base(16);
-5433
> my uint16 $y = $x.uint16;
No such method 'uint16' for invocant of type 'Int'
13 matches
Mail list logo