From 2a3cebc5ad7186415bb2e0c4acd24b3c922c4de1 Mon Sep 17 00:00:00 2001 From: Steve Mynott Date: Tue, 19 Dec 2017 19:06:27 +0000 Subject: update to Diwalish version from mu repo --- docs/cheatsheet.txt | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/docs/cheatsheet.txt b/docs/cheatsheet.txt index 484e063..bd8a56d 100644 --- a/docs/cheatsheet.txt +++ b/docs/cheatsheet.txt @@ -1,4 +1,4 @@ -Perl 6 cheat sheet v5 20151203 »ö« +Perl 6 cheat sheet v6 20171128 »ö« SIGILS MAJOR/MINOR CONTEXTS ACCESS ARRAYS HASHES $scalar item list sink whole: @array[] %hash{} @@ -13,30 +13,30 @@ $*dynamic-or-global (,) list @($foo)[1] == $foo[1] $.public-accessor :() signature %($foo){'bar'} == $foo $!private-attribute \() capture @(@($foo)[1])[2] == $foo[1][2] $^positional-param -$:named-parameter CONTROL SYNTAX -$=pod-info for LIST { } # implicit $_ arg -$ for LIST -> $a, $b { } # explicit args -$~slang-variable while/until EXPR { } - repeat while/until EXPR { } # do at least once -OPERATOR PRECEDENCE loop { } loop (a;b;c) { } # parens required! -.method .[] i if EXPR { } elsif EXPR { } else { } -++ -- unless EXPR { } # no else allowed! -** given EXPR { when EXPR { } default { } } -unary + - ~ ! ? ^ EXPR if EXPR for LIST; # list comprehension -* / % %% div next, last, redo # loop controls -+ - proceed, succeed # switch controls +$:named-parameter CONTROL SYNTAX +$=pod-info for LIST { } # implicit $_ arg +$ for LIST -> $a, $b { } # explicit args +$~slang-variable while/until EXPR { } + repeat while/until EXPR { } # do at least once +OPERATOR PRECEDENCE loop { } loop (a;b;c) { } # parens required! +.method .[] i if EXPR { } elsif EXPR { } else { } # truthy +++ -- with EXPR { } orwith EXPR { } else { } # defined +** given EXPR { when EXPR { } default { } } +unary + - ~ ! ? ^ EXPR if EXPR for LIST; # list comprehension +* / % %% div next, last, redo # loop controls ++ - proceed, succeed # switch controls x xx TYPES -~ Bool Bit Int Rat FatRat UInt Num Complex int32 complex64 etc. -& Str Cat Blob Char Byte Codepoint Grapheme Buf buf8 buf32 utf8 -| ^ IO Mu Any Cool Junction Supply Whatever Match Nil +~ Bit Int Rat FatRat UInt Num Complex int8 int32 complex64 etc. +& Str Buf Blob Uni NFC NFD NFKC NFKD buf8 buf16 buf32 utf8 +| ^ IO Mu Any Cool Junction Supply Whatever Slip Empty sleep abs sin temp let List Capture Signature <=> leg cmp .. but SCOPE DECLARATORS Pair Range Set Bag Mix ~~ > == gt eq === eqv !op my lexical scope SetHash BagHash MixHash && our package scope Scalar Array Hash Code -|| ^^ // min max has instance scope Enum Order TrigBase +|| ^^ // min max has instance scope Enum Bool Order Signal ??!! ff anon no scope at all Block Routine Sub -= := op= => state persistent lexical Method Regex Cursor -so not augment benign parasitic Failure Exception += := op= => state persistent lexical Method Regex Match +so not augment benign parasitic Nil Failure Exception , : supersede deadly parasitic Instant Duration X Xop Z Zop ... Date DateTime say die map etc. OPERATOR DOMAINS @@ -44,9 +44,9 @@ and Numeric: == !==(!=) + < > <=> <= >= or xor Stringy: eq !eq(ne) ~ lt gt leg le ge <== ==> Value: eqv !eqv before after cmp !after !before ObjectID: === !=== -METAOPERATORS LINKS IRC -[op] reduce listop to A op B op C... perl6.org #perl6 irc.freenode.net -op= A = A op B rakudo.org #moarvm irc.freenode.net +METAOPERATORS LINKS IRC on irc.freenode.net +[op] reduce listop to A op B op C... perl6.org #perl6 #perl6-dev +op= A = A op B rakudo.org #moarvm !op !(A op B) »op« hyper/vectorize REGEX METACHARS REGEX MODIFIERS Zop zip with op ^ $ string begin/end :i ignore case -- cgit v1.1