Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,16 @@
# Array
my @array = 1,2,3;
@array.push: 4,5,6;
# Hash
my %hash = 'a' => 1, 'b' => 2;
%hash<c d> = 3,4;
%hash.push: 'e' => 5, 'f' => 6;
# SetHash
my $s = SetHash.new: <a b c>;
$s = <d e f>;
# BagHash
my $b = BagHash.new: <b a k l a v a>;
$b = <a b c>;

View file

@ -0,0 +1,11 @@
# List
my @list := 1,2,3;
my @newlist := |@list, 4,5,6; # |@list will slip @list into the surrounding list instead of creating a list of lists
# Set
my $set = set <a b c>;
my $newset = $set <d e f>;
# Bag
my $bag = bag <b a k l a v a>;
my $newbag = $bag <b e e f>;

View file

@ -0,0 +1,2 @@
my $tail = d => e => f => Nil;
my $new = a => b => c => $tail;

View file

@ -0,0 +1,3 @@
class Something { has $.foo; has $.bar };
my $obj = Something.new: foo => 1, bar => 2;
my $newobj = $obj but role { has $.baz = 3 } # anonymous mixin