New addition to my hash keeper:
"returns" hash on a sub declaration:
Note: "Associative" will return a hash or a map or even a pair
> sub x() returns Associative { my %h= A=>"a"; return %h}
&x
> x
{A => a}
> sub x(--> Hash) { my %h= A=>"a", B=>"b"; return %h}
&x
On 2020-01-16 00:38, Laurent Rosenfeld via perl6-users wrote:
> one of those "Magic" variables that is unbounded, meaning
> I can have a 1024 bit integer if I choose?
Yeah, and even a 1024-digit integer, or much larger, if so you wish.
I love it!
At some point, I love to know how Larry did
> one of those "Magic" variables that is unbounded, meaning
> I can have a 1024 bit integer if I choose?
Yeah, and even a 1024-digit integer, or much larger, if so you wish.
Le jeu. 16 janv. 2020 à 04:28, ToddAndMargo via perl6-users <
perl6-users@perl.org> a écrit :
> >> On Wed, Jan 15, 2020
On 2020-01-15 21:43, Aureliano Guedes wrote:
Thanks ToddAndMargo
Perhaps I have some questions to help improve the docs (I think):
1- You told about arrays of hashes, in Perl5 the opposite (hashes of
arrays) is quite fuzzy. Then, in Raku, how do I deal with hashes of arrays?
2 - "[...]say %h
> my Int $oK = 2**1024
17976931348623159077293051907890247336179769789423065727343008115773267580550096313270847732240753602112011387987139335765878976881441662249284743063947412437776789342486548527630221960124609411945308295208500576883815068234246288147391311054082723716335051068458629823994724
Thanks ToddAndMargo
Perhaps I have some questions to help improve the docs (I think):
1- You told about arrays of hashes, in Perl5 the opposite (hashes of
arrays) is quite fuzzy. Then, in Raku, how do I deal with hashes of arrays?
2 - "[...]say %h:p; # note: no comma between the a and the b[..
On Wed, Jan 15, 2020 at 6:00 PM ToddAndMargo via perl6-users
mailto:perl6-users@perl.org>> wrote:
A recent addition to my hashes keeper:
Confining hashes:
Note: as of 2020-01-15, confining only works with Str.
And you must confine the entire hash, not each
Capital I in Int, to not use native type
> my Int %h = A => 123
{A => 123}
-y
On Wed, Jan 15, 2020 at 6:00 PM ToddAndMargo via perl6-users <
perl6-users@perl.org> wrote:
> A recent addition to my hashes keeper:
>
>
> Confining hashes:
> Note: as of 2020-01-15, confining only works wit
A recent addition to my hashes keeper:
Confining hashes:
Note: as of 2020-01-15, confining only works with Str.
And you must confine the entire hash, not each member
my Str %h = A => "a"
{A => a}
my int %h = A => 123
native value types for hashes not yet
On 2019-12-06 02:39, ToddAndMargo via perl6-users wrote:
Hi All,
My favorite variable is the associative array (hash). I finally updated
my keeper file on them.
If anyone is interested, here goes!
-T
Hi All,
Okay, here it is again with the booboo Mark pointed
to me corrected.
Please fe
On 2019-12-07 22:43, William Michels via perl6-users wrote:
On Sat, Dec 7, 2019 at 9:36 PM ToddAndMargo via perl6-users
wrote:
On 2019-12-07 18:30, Mark Senn wrote:
Corrected section
my %h = a => "x", b=>"r", c=>"z";
if %h { say "exists"; } else { say "DOES NOT exist"; }
On Sat, Dec 7, 2019 at 9:36 PM ToddAndMargo via perl6-users
wrote:
>
> On 2019-12-07 18:30, Mark Senn wrote:
> >> Corrected section
> >>
> >> my %h = a => "x", b=>"r", c=>"z";
> >> if %h { say "exists"; } else { say "DOES NOT exist"; }
> >> DOES NOT exist
> >>
> >>
On 2019-12-07 18:30, Mark Senn wrote:
Corrected section
my %h = a => "x", b=>"r", c=>"z";
if %h { say "exists"; } else { say "DOES NOT exist"; }
DOES NOT exist
if %h { say "exists"; } else { say "DOES NOT exist"; }
exists
Hi.
The following code prints
On 2019-12-06 16:15, ToddAndMargo via perl6-users wrote:
Checking for the presence of a key/value:
my %h = a => "x", b=>"r", c=>"z";
if %h { say "exists"; } else { say "DOES NOT exist"; }
DOES NOT exist
if %h { say "exists"; } else { say "DOES NOT exist"; }
On 2019-12-06 10:24, JJ Merelo wrote:
Please use the new URLs, those are deprecated, are no longer updated,
and might stop working without prior notice:
https://docs.raku.org/language/subscripts#Basics
https://docs.raku.org/type/Hash#:exists
Cheers
JJ
Hi JJ,
Good catch. Thank you!
I hav
El vie., 6 dic. 2019 a las 11:46, ToddAndMargo via perl6-users (<
perl6-users@perl.org>) escribió:
> Hi All,
>
> My favorite variable is the associative array (hash). I finally updated
> my keeper file on them.
>
> If anyone is interested, here goes!
>
> -T
>
>
> Perl 6 Hashes (associative arrays
16 matches
Mail list logo