• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Perl 6 Datenstrukturen
 

Perl 6 Datenstrukturen

on

  • 277 views

Funktionsweisen der Perl 6 arrays and Hashes erklärt, mit Beispielen und einem lustigen Quiz

Funktionsweisen der Perl 6 arrays and Hashes erklärt, mit Beispielen und einem lustigen Quiz

Statistics

Views

Total Views
277
Views on SlideShare
277
Embed Views
0

Actions

Likes
0
Downloads
1
Comments
0

0 Embeds 0

No embeds

Accessibility

Upload Details

Uploaded via as OpenOffice

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • multiply a list
  • multiply a list

Perl 6 Datenstrukturen Perl 6 Datenstrukturen Presentation Transcript

  • Perl 6 Data Structures
  • Herbert Breunung
  • CPAN: lichtkind
  • Kephra 0.4.3.32
  • Kephra Logo
  • Als Hieroglyphe
  • Mansfelder Land
  • Mansfelder Land
  • Egypt aka Khem
  • Ein (K|C)amel
  • Noch ein Kamel?
  • Camelia
  • Camel ia
  •  
  • Schlaraffenland
  • Heiliger Gral
  • Schönheit Und Struktur
  • Datenstrukturen
  •  
  • @rrays Und %ashes
  • Auch $calare
  • Perl 5
      @cities = ( 'roma' , 'milano' , 'torino' );
  • Perl 5 & 6
      @cities = ( 'roma' , 'milano' , 'torino' );
  • Perl 5
      @cities = qw( roma milano torino );
  • Perl 6
      @cities = qw( roma milano torino ); @cities = < roma milano torino >;
  • Mit Interpolation Wie “ “
      @cities = qw( roma milano torino ); @cities = < roma milano torino >; @cities = << roma milano $city >>;
  • Perl 5 & 6
      @cities = ( 'roma' , 'milano' , 'torino' );
  • P5 & P6
      @cities = ( 'roma' , 'milano' , 'torino' ); @cities = 'roma' , 'milano' , 'torino' ;
  • Klammern Gruppieren !
      @cities = ( 'roma' , 'milano' , 'torino' ); @cities = 'roma' , 'milano' , 'torino' ;
  • Itemkontext
      $cities = ( 'roma' , 'milano' , 'torino' ); $cities = 'roma' , 'milano' , 'torino' ;
  • Itemkontext
      # Parcel() $cities = ( 'roma' , 'milano' , 'torino' ); # Str() $cities = 'roma' , 'milano' , 'torino' ;
  • Was Ist Str ?
      # Parcel() $cities = ( 'roma' , 'milano' , 'torino' ); # Str() - 'roma' ist ein String $cities = 'roma' , 'milano' , 'torino' ;
  • Nur Der Erste Wert
      # Parcel() $cities = ( 'roma' , 'milano' , 'turino' ); # $a, $b, $c = 1, 2, 3; $cities = 'roma' , 'milano' , 'torino' ;
  • Was Ist Ein Parcel ?
      # Parcel – Sequenz von Items $cities = ( 'roma' , 'milano' , 'torino' ); # Str() $cities = 'roma' , 'milano' , 'torino' ;
  • () Erinnert An Was?
      # Parcel – wie in function(1,2,3); $cities = ( 'roma' , 'milano' , 'torino' ); # Str() $cities = 'roma' , 'milano' , 'torino' ;
  • Parcel
      # hat pos. und benannte Args $cities = ( 'roma' , 'milano' , 'torino' ); # Str() $cities = 'roma' , 'milano' , 'torino' ;
  • Kontainertypen
      # Array() $cities = [ 'roma' , 'milano' , 'torino' ]; # Parcel() $cities = ( 'roma' , 'milano' , 'torino' );
  • Array() ne List() ne Parcel()
      # List() $cities = @( 'roma' , 'milano' , 'torino' ); # Parcel() $cities = ( 'roma' , 'milano' , 'torino' );
  • Nur Eine Liste
      # List() $cities = list ( 'roma' , 'milano' , 'torino' ); # Parcel() $cities = ( 'roma' , 'milano' , 'torino' );
  • Pos. Param. Als Liste
      # List() $cities = list ( 'roma' , 'milano' , 'torino' ); # List() $cities = ||( 'roma' , 'milano' , 'torino' );
  • Array Objekt
      $cities = [ 'roma' , 'milano' , 'torino' ]; @cities = 'roma' , 'milano' , 'torino' ; say $cities . WHAT # Array() say @cities . WHAT # Array()
  • Nummer An Elementen
      say length @cities ; # 3 say elems @cities ; # 3 # kein length
  • „ elems“ Ist Methode
      say length @cities ; # 3 say @cities . elems ; # 3
  • An Jedem Arrayobjekt
      say scalar @$cities ; # 3 say $cities . elems ; # 3
  • Inhalt Vom Skalar
      say “@$cities“ ; # roma ... say $cities ; # roma ...
  • Auch Im Skalarkontext
      say “@cities“ ; # roma ... say $( @cities ) ; # roma ...
  • Ich Meinte Itemkontext
      say “@cities“ ; # roma ... say item( @cities ) ; # roma ...
  • Numerischer Kontext
      say scalar @cities ; # 3 say + @cities ; # 3
  • Numerischer Kontext
      say scalar @$cities ; # 3 say + $cities ; # 3
  • Boolkontext
      say values @cities ; # romami... say ? @cities ; # Bool::True
  • Stringkontext
      say “@cities“ ; # roma milano say ~ @cities ; # roma milano ...
  • . Wurde ~
      say “@cities“ ; # roma milano say “...“ ~ @cities ; # ...roma mila..
  • Gehts Auch in P6 ?
      say “ @cities“ ; # roma milano torino say “@cities“ ; # roma milano torino?
  • Nicht Ganz
      say “@cities“ ; # roma milano ... say “@cities“ ; # @cities
  • Füge „[]“ An
      say “@cities“ ; # roma milano say “@cities[]“ ; # roma milano ...
  • Das War Kein Spezialfall
      say “@cities“ ; # roma milano say @cities [] ; # roma milano ...
  • Perl 5 & 6
      say @cities ; # romamilanotorino say @cities ; # roma milano torino
  • Tiefer Als Listen
  • STD Perl 5
      use Data::Dumper ; say Dumper ( @cities );
  • $VAR1 = 2; $VAR2 = 3; $VAR3 = 4; $VAR4 = 5; $VAR5 = 6; $VAR6 = 7; $VAR7 = 7; $VAR8 = 2; $VAR9 = 5; $VAR10 = [ 'a', 'b', 'c' ]; [2, 3, 4, 5, 6, 7, 7, 2, 5, [&quot;a&quot;, &quot;b&quot;, &quot;c&quot;]] Data::Dumper Ausgabe
  • Er Hats Repariert
      use YAML ; # Data::Dumper sucks say Dump @cities ;
  • --- - 2 - 3 - 4 - 5 - 6 - 7 - 7 - 2 - 5 - - a - b - c [2, 3, 4, 5, 6, 7, 7, 2, 5, [&quot;a&quot;, &quot;b&quot;, &quot;c&quot;]] YAML Ausgabe
  • --- - 2 - 3 - 4 - 5 - 6 - 7 - 7 - 2 - 5 - - a - b - c [2, 3, 4, 5, 6, 7, 7, 2, 5, [&quot;a&quot;, &quot;b&quot;, &quot;c&quot;]] Er Kanns Kürzer
  • Perl 6
      say @cities . perl ;
  • Mit eval Rückwandelbar
      # in jeder Tiefe: say @cities . perl ; $ [&quot;roma&quot;, &quot;milano&quot;, &quot;torino&quot;]
  • Perl 5
      say $cities [ 2 ]; # torino
  • Perl 6
      say $cities [ 2 ]; # torino say @cities [ 2 ]; # torino
  • Array Als Item
      say $cities [ 2 ]; # in Perl 6 auch say @cities [ 2 ]; # torino
  • Der Selbe Kontainertyp
      $cities = [ 'roma' , 'milano' , 'torino' ]; say $cities [ 2 ]; # $cities.WHAT say @cities [ 2 ]; # @cities.WHAT
  • Arrayobjekt
      say $cities [ 2 ]; # Array() say @cities [ 2 ]; # Array()
  • Say Ist Eine Methode
      say $cities [ 2 ]; # torino @cities [ 2 ]. say ; # dito
  • [ ] Auch (Wie Jeder Op)
      say $cities .[ 2 ]; # 2 ist parameter @cities .[ 2 ]. say ; # dito
  • 2 ist Letzter Index
      say $cities [ 2 ]; # torino say @cities [ 2 ]; # dito
  • Perl 5
      say $cities [ -1 ]; # torino say @cities [ 2 ]; # dito
  • Perl 6
      say $cities [ -1 ]; # torino say @cities [* -1 ]; # dito
  • Whatever *
      say @cities [*- 1 ]; # torino
  • Whatever *
      say @cities [*- 1 ]; # torino # parameter „*-1“ ist eine closure
  • Whatever *
      say @cities [*- 1 ]; # torino # parameter „*-1“ ist eine closure # * ist parameter an diese closure
  • Whatever *
      say @cities [*- 1 ]; # turino # parameter „*-1“ ist eine closure # * ist parameter an diese closure # * enthält gesammten Array
  • Whatever *
      say @cities [*- 1 ]; # torino say @cities [* / 2 ]; # milano
  • Whatever *
      say “@cities“ ; # roma milano torino say @cities [*]; # roma milano torino
  • Whatever *
      say “@cities“ ; # roma milano torino say @cities []; # roma milano torino # default param ist *
  • LoL
      say @cities [ 1 ][ 1 ];
  • List Of List
      @cities = [< roma .. >], [< berlin .. >]; say @cities [ 1 ][ 1 ]; say $cities [ 1 ; 1 ];
  • Ein Spiel
  • Zähl die Schlümpfe
  • Zähle
      Wie viele Elemente hat diese Liste?
  • Count
  • Runde 1
  • Wie Viele Elemente ?
      my @number = 1 , 2 , 3 , 4 ;
  • Wie Viele Elemente ?
      my @number = 1 , 2 , 3 , 4 ; # 4 my @number = ( 1 , 2 , 3 , 4 );
  • Wie Viele Elemente ?
      my @number = 1 , 2 , 3 , 4 ; # 4 my @number = ( 1 , 2 , 3 , 4 ); # 4 my @number = 1 , ( 2 , 3 ), 4 ;
  • Wie Viele Elemente ?
      my @number = 1 , 2 , 3 , 4 ; # 4 my @number = ( 1 , 2 , 3 , 4 ); # 4 my @number = 1 , ( 2 , 3 ), 4 ; # 4 my @number = 1 , [ 2 , 3 ], 4 ;
  • Wie Viele Elemente ?
      my @number = 1 , 2 , 3 , 4 ; # 4 my @number = ( 1 , 2 , 3 , 4 ); # 4 my @number = 1 , ( 2 , 3 ), 4 ; # 4 my @number = 1 , [ 2 , 3 ], 4 ; # 3 my @number = [ 1 , 2 , 3 , 4 ];
  • Wie Viele Elemente ?
      my @number = 1 , 2 , 3 , 4 ; # 4 my @number = ( 1 , 2 , 3 , 4 ); # 4 my @number = 1 , ( 2 , 3 ), 4 ; # 4 my @number = 1 , [ 2 , 3 ], 4 ; # 3 my @number = [ 1 , 2 , 3 , 4 ]; # 1 mysub 1 ,( 2 ,[ 3 , 4 ]), 5 ; # in @_
  • Wie Viele Elemente ?
      my @number = 1 , 2 , 3 , 4 ; # 4 my @number = ( 1 , 2 , 3 , 4 ); # 4 my @number = 1 , ( 2 , 3 ), 4 ; # 4 my @number = 1 , [ 2 , 3 ], 4 ; # 3 my @number = [ 1 , 2 , 3 , 4 ]; # 1 mysub 1 ,( 2 ,[ 3 , 4 ]), 5 ; # 4 # + Params. von außerhalb der ( )
  • Runde 2
  • Wie Viele Elemente ?
      my $number = 1 , 2 , 3 , 4 ;
  • Wie Viele Elemente ?
      my $number = 1 , 2 , 3 , 4 ; # 1 my $number = ( 1 , 2 , 3 , 4 );
  • Wie Viele Elemente ?
      my $number = 1 , 2 , 3 , 4 ; # 1 my $number = ( 1 , 2 , 3 , 4 ); # 4 my $number = 1 , ( 2 , 3 ), 4 ;
  • Wie Viele Elemente ?
      my $number = 1 , 2 , 3 , 4 ; # 1 my $number = ( 1 , 2 , 3 , 4 ); # 4 my $number = 1 , ( 2 , 3 ), 4 ; # 1 my $number = ( 1 , 2 ), 3 , 4 ;
  • Wie Viele Elemente ?
      my $number = 1 , 2 , 3 , 4 ; # 1 my $number = ( 1 , 2 , 3 , 4 ); # 4 my $number = 1 , ( 2 , 3 ), 4 ; # 1 my $number = ( 1 , 2 ), 3 , 4 ; # 2 my $number = ( 1 , [ 2 , 3 ], 4 );
  • Wie Viele Elemente ?
      my $number = 1 , 2 , 3 , 4 ; # 1 my $number = ( 1 , 2 , 3 , 4 ); # 4 my $number = 1 , ( 2 , 3 ), 4 ; # 1 my $number = ( 1 , 2 ), 3 , 4 ; # 2 my $number = ( 1 , [ 2 , 3 ], 4 ); # 3 my $number = [ 1 , 2 , 3 , 4 ];
  • Wie Viele Elemente ?
      my $number = 1 , 2 , 3 , 4 ; # 1 my $number = ( 1 , 2 , 3 , 4 ); # 4 my $number = 1 , ( 2 , 3 ), 4 ; # 1 my $number = ( 1 , 2 ), 3 , 4 ; # 2 my $number = ( 1 , [ 2 , 3 ], 4 ); # 3 my $number = [ 1 , 2 , 3 , 4 ]; # 4
  • Runde 3
  • Wie Viele Elemente ?
      my $pd = my @pd = ( 3 , 1 , 4 , 1 );
  • Wie Viele Elemente ?
      my $pd = my @pd = ( 3 , 1 , 4 , 1 ); @number = 1 , @pd , 4 ;
  • Wie Viele Elemente ?
      my $pd = my @pd = ( 3 , 1 , 4 , 1 ); @number = 1 , @pd , 4 ; # 6 @number = 1 , $pd , 4 ;
  • Wie Viele Elemente ?
      my $pd = my @pd = ( 3 , 1 , 4 , 1 ); @number = 1 , @pd , 4 ; # 6 @number = 1 , $pd , 4 ; # 3 @number = 1 , @pd . item , 4 ;
  • item & list == Konextops
      my $pd = my @pd = ( 3 , 1 , 4 , 1 ); @number = 1 , @pd , 4 ; # 6 @number = 1 , $pd , 4 ; # 3 @number = 1 , @pd . item , 4 ; # 3 @number = 1 , $pd . list , 4 ;
  • Wie Viele Elemente ?
      my $pd = my @pd = ( 3 , 1 , 4 , 1 ); @number = 1 , @pd , 4 ; # 6 @number = 1 , $pd , 4 ; # 3 @number = 1 , @pd . item , 4 ; # 3 @number = 1 , $pd . list , 4 ; # 6 @number = Nil , Nil , Nil ;
  • Nil != undef
      my $pd = my @pd = ( 3 , 1 , 4 , 1 ); @number = 1 , @pd , 4 ; # 6 @number = 1 , $pd , 4 ; # 3 @number = 1 , @pd . item , 4 ; # 3 @number = 1 , $pd . list , 4 ; # 6 @number = Nil , Nil , Nil ; # 0
  • And The Winner Is ...
  • Perl 5
      @digits = ( 4 ) x 5 ; # (4,4,4,4,4)
  • Perl 6
      @digits = ( 4 ) x 5 ; # (4,4,4,4,4) @digits = ( 4 ) xx 5 ; # 4,4,4,4,4
  • Verfielfacht Listen
      @digits = ( 4 ) x 5 ; # (4,4,4,4,4) @digits = 4 xx 5 ; # 4,4,4,4,4
  • Verfielfacht Strings
      @digits = 4 x 5 ; # '44444' @digits = 4 x 5 ; # '44444'
  • Verfielfacht Strings
      @digits = 4 x 5 ; # '44444' @digits = ( 4 ) x 5 ; # '44444'
  • Verfielfacht Strings
      @digits = '1 2' x 3 ; # '1 21 21 2' @digits = ( 1 , 2 ) x 3 ; # '1 21 21 2'
  • Verfielfacht Listen
      @digits = ( 1 , 2 ) x 3 ; # 1,2,1,2,1,2 @digits = ( 1 , 2 ) xx 3 ; # 1,2,1,2,1,2
  • Perl 5
      @digits = ( 0 .. 9 ); # Bereichsop
  • Perl 5 & 6
      @digits = ( 0 .. 9 );
  • Perl 6
      @digits = 0 .. 9 ;
  • Perl 6
      @digits = ^ 10 ; # 0 .. 9
  • 0 Ist Gegeben
      @digits = 0 ..^ 10 ; # 0 .. 9 (@)
  • ^ Schließt Schranke Aus
      @digits = -1 ^..^ 10 ; # 0 .. 9
  • Sequence - Operator
      @digits = 0 ... 9 ;
  • Linear
      @digits = 0 ... 9 ; # 0 .. 9
  • Arithmetisch
      @digits = 0 ... 9 ; # 0 .. 9 @odd = 1 , 3 … 9 ; # 1,3,5,7,9
  • Geometrisch
      @digits = 0 ... 9 ; # 0 .. 9 @odd = 1 , 3 … 9 ; # 1,3,5,7,9 @bin = 1 , 2 , 4 … 1024 ; #..,8,16,32,.
  • Fibonacci
      @digits = 0 ... 9 ; # 0 .. 9 @odd = 1 , 3 … 9 ; # 1,3,5,7,9 @bin = 1 , 2 , 4 … 1024 ; #..,8,16,32,. @fib = 0 , 1 ,*+* … 144 ; #..,1,2,3,..
  • Prüf Das Limit
      @odd = 1 , 3 … 10 ; # 1,3,.. *
  • Unendliche Liste
      @odd = 1 , 3 … 10 ; # 1,3,.. * @number = 0 .. *; # 0 .. Inf
  • Bestimmte Elemente
      @odd = 1 , 3 … 10 ; # 1,3,.. * @number = 0 .. *; # 0 .. Inf say @odd [ 1 ]; # 3 say @number [ 5 ]; # 4
  • Alle Elemente
      @odd = 1 , 3 … 10 ; # 1,3,.. * @number = 0 .. *; # 0 .. Inf say @odd [*]; # warten ... say @number ; # viele Ziffern
  • Anzahl Der Elemente
      @odd = 1 , 3 … 10 ; # 1,3,.. * @number = 0 .. *; # 0 .. Inf say + @odd ; # warten ... say @number ; # viele Ziffern
  • Was ist geschehen?
      $number = 0 .. *; # 0 .. Inf say $number . WHAT ; # Range()
  • Ausgabe ?
      $number = 0 .. *; # 0 .. Inf say $number ; # ?
  • Erstes Element
      $number = 0 .. *; # 0 .. Inf say $number ; # 0
  • Unendliche Liste
      $number = 0 .. *; # 0 .. Inf say @( $number ); # digits ...
  • Array
      @number = 0 .. *; # 0 .. Inf say @number [ 5 ];
  • Bei Bedarf Erzeugt
      @number = 0 .. *; # 0 .. Inf say @number [ 5 ]; # @number.reify(5)
  • Interne Repräsentation
      @number = 0 .. *; # 0 .. Inf say @number . reify ( 5 ). perl ; # (0, 1, 2, 3, 4, 5, 6..*)
  • Ihr Kennt Diese
      shift unshift push pop splice reverse map grep
  • Perl 5
      %opera = ( 'verdi' => 'Aida' , 'puccini' => 'Turandot' , 'rossini' => 'Il barbiere' , );
  • Perl 6
      %opera = ( 'verdi' => 'Aida' , 'puccini' => 'Turandot' , 'rossini' => 'Il barbiere' , );
  • Kein Gruppieren Nötig
      %opera = 'verdi' => 'Aida' , 'puccini' => 'Turandot' , 'rossini' => 'Il barbiere' , ;
  • Immer Noch Ein Hash
      %opera = 'verdi' => 'Aida' , 'puccini' => 'Turandot' , 'rossini' => 'Il barbiere' , ; %opera . WHAT eq 'Hash()'
  • Neuer Paar-Syntax
      %opera = : verdi ( 'Aida' ), : puccini ( 'Turandot' ), : rossini ( 'Il barbiere' ), ; %opera . WHAT eq 'Hash()'
  • Mit Autoquoting
      %opera = : verdi < Aida >, : puccini < Turandot >, : rossini < Il barbiere >, ; %opera . WHAT eq 'Hash()'
  • Item - Kontext
      $opera = : verdi < Aida >, : puccini < Turandot >, : rossini < Il barbiere >, ; $opera . WHAT eq 'Pair()'
  • Gruppiert
      $opera = ( : verdi < Aida >, : puccini < Turandot >, : rossini < Il barbiere >, ); %opera . WHAT eq 'Parcel()'
  • Packet Kennt Pos.
      $opera = ( : verdi < Aida >, : puccini < Turandot >, : rossini < Il barbiere >, ); 0 verdi Aida 1 puccini Turandot 2 rossini Il barbiere
  • Hashkontext - Op
      $opera = %( : verdi < Aida >, : puccini < Turandot >, : rossini < Il barbiere >, ); %opera . WHAT eq 'Hash()'
  • Hashkontext - Op
      $opera = hash( : verdi < Aida >, : puccini < Turandot >, : rossini < Il barbiere >, ); %opera . WHAT eq 'Hash()'
  • Hash-Generator-Op
      $opera = { : verdi < Aida >, : puccini < Turandot >, : rossini < Il barbiere >, }; %opera . WHAT eq 'Hash()'
  • Hash - Generator - Op
      %opera = { : verdi < Aida >, : puccini < Turandot >, : rossini < Il barbiere >, }; %opera . WHAT eq 'Hash()'
  • Invariante Sigils
      %opera { 'rossini' }; # Il barbiere
  • Invariante Sigils
      %opera .{ 'rossini' }; # alias .at_key()
  • Erinnern An qw() ?
      %opera { 'rossini' }; # Il barbiere %opera < rossini >;
  • Mit Interpolation
      %opera { 'rossini' }; # Il barbiere %opera < rossini >; %opera << $autore >>;
  • 2 Opern Auf Einmal
      %opera { 'rossini' , 'puccini' }; %opera < rossini puccini >; %opera << @autore >>;
  • Sind Auch Hashes
      $opera { 'rossini' , 'puccini' }; $opera < rossini puccini >; $opera << @autore >>;
  • Auch Mit Parcel()
      # oder Capture() $opera { 'rossini' , 'puccini' }; $opera < rossini puccini >; $opera << @autore >>;
  • Hash Methoden
      %opera . keys ; # verdi puccini ro... %opera . values ; # aida turandot ... %opera . kv ; # verdi aida puccini ...
  • Haben Arrays Auch
      @cities . keys ; # 0 1 2 @cities . values ; # roma milano ... @cities . kv ; # 0 roma 1 milano 2 ...
  • Auch Paare
      $opera . key ; # rossini $opera . value ; # Il barbiere $opera ; #
  • Mehr Hash Methoden
      %opera . pairs ; # list of pair obj. %opera . exists ; # Bool %opera . delete ; # 1 | 0
  • Mehr Hash Methoden
      %opera . pairs ; # list of pair obj. %opera . exists ; # one at a time %opera . delete ; # one at a time
  • Hash Im Kontext
      ? %opera ; # bool Kontext + %opera ; # num Kontext ~ %opera ; # string Kontext
  • Hash Im Kontext
      ? %opera ; # Bool::True + %opera ; # 3 ~ %opera ; # rossini Il barbiere
  • Value Im Kontext
      ? %opera ; # Bool::True + %opera ; # 3 ~ %opera ; # rossini Il barbiere
  • Neue Hashmethoden
      say %opera . invert ; Aida verdi Turandot puccini Il barbiere rossini
  • Hash Erzeuger
      my %h = @cities . classify ( { uc substr ( $_ , 0 , 1 ) } ); say %h ; $ R roma M milano T torino
  • Hash Erzeuger
      @cities . categorize ({ catsub ( $_ ) }); say %h . perl ;
  • Hash Erzeuger
      @cities . categorize ({ water ( $_ ) }); say %h . perl ; {&quot;mare&quot; => [&quot;roma&quot;], &quot;fiume&quot; => [&quot;roma&quot;, &quot;milano&quot;, &quot;torino&quot;], &quot;lago&quot; => Nil}
  • ==>
      Pipes
  • Schwartz. Transform
      @results = map {…}, sort {…}, map {...}, @input ;
  • Schwartz. Transform
      @results = map {…}, sort {…}, map {...}, @input ; @results = map {…} <== sort {…} <== map {…} <== @input ;
  • Schwartz. Transform
      @results = map {…}, sort {…}, map {...}, @input ; @results <== map {…} <== sort {…} <== map {…} <== @input ;
  • Schwartz. Transform
      @results = map {…}, sort {…}, map {...}, @input ; @input ==> map {…} ==> sort {…} ==> map {…} ==> @results ;
  • Metaops
  • Metaops
      = ! R
  • Metaops
      >> [ ] [ ] X Z S
  • Metaops
      >> [ ] [ ] X Z S
  • Hyperoperator
      >>
  • Hyperoperator
      >> .hyper()
  • Simple Example
      ( 1 .. 5 ) >>++
  • That Works
      @number >>++
  • Result
      @number >>++ 2 , 3 , 4 , 5 , 6
  • More Complicated
      ( 1 .. 5 ) >>+>> 1
  • Check Your Spaces
      (1..5) _ >>+>> _ 1
  • Same Result
      ( 1 .. 5 ) >>+>> 1 2 , 3 , 4 , 5 , 6
  • Reverse Hyper
      ( 1 .. 5 ) <<+<< 1
  • Right Side Rules
      ( 1 .. 5 ) <<+<< 1 2
  • Both Rule ?
      ( 1 .. 5 ) >>+<< 1
  • Yes Both!
      ( 1 .. 5 ) >>+<< 1 Runtime Error !!!
  • Preserves LoL ?
      ( 1 .. 5 , [ 6 .. 9 ]) >>+>> 1
  • Preserves LoL !
      ( 1 .. 5 , [ 6 .. 9 ]) >>+>> 1 2 , 3 , 4 , 5 , 6 , [ 7 , 8 , 9 , 10 ]
  • On 2 Sides ?
      ( 1 .. 5 , [ 6 .. 9 ]) >>+<< ( 0 .. 4 , [ 1 .. 4 ])
  • On 2 Sides !
      ( 1 .. 5 , [ 6 .. 9 ]) >>+<< ( 0 .. 4 , [ 1 .. 4 ]) ( 1 , 3 , 5 , 7 , 9 , [ 7 , 9 , 11 , 13 ])
  • How About This?
      ( 1 .. 5 , [ 6 .. 9 ]) >>+<< ( 0 .. 4 , [ 1 .. 5 ])
  • Checks Lengths
      ( 1 .. 5 , [ 6 .. 9 ]) >>+<< ( 0 .. 4 , [ 1 .. 5 ]) Runtime Error
  • Reduce
      [ ] .reduce
  • Do The Gauss
      [+] ( 1 .. 100 )
  • Do The Gauss
      [+] ( 1 .. 100 ) 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + ...
  • 100+1 * 50
      [+] ( 1 .. 100 ) 5050
  • Chained Comparsion
      [<] ( 1 .. 100 )
  • Chained Comparsion
      [<] ( 1 .. 100 ) 1 < 2 < 3 < 4 < 5 < 6 < 7 < 8 < ...
  • Chained Comparsion
      [<] ( 1 .. 100 ) Bool::True
  • Junction
      all ( 1 .. 100 ) > 0
  • Junction
      all ( 1 .. 100 ) 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | ...
  • Junction
      all ( 1 .. 100 ) > 0 ( True , True , True , True , ...
  • Bool Context
      ? all ( 1 .. 100 ) > 0 True
  • Bool Context
      ? all ( 1 .. 100 ) > 1 False
  • Metaops
      >> [ ] [ ] X Z S
  • Triangle
      [ ] triangle()
  • Back To Gauss
      [+] ( 1 .. 100 )
  • Returns A List
      [+] ( 1 .. 100 ) ((((( 1 ) + 2 ) + 3 ) + 4 ) + 5 ) + 6 ) + ...
  • Returns A List
      [+] ( 1 .. 100 ) ( 1 , 3 , 6 , 10 , 15 , 21 , 28 , ...
  • Metaops
      >> [ ] [ ] X Z S
  • Cross
      .crosswith X
  • Cross
      ( 1 , 2 ) X ( 1 , 2 ) 11 , 12 , 21 , 22
  • Cross With Power
      ( 1 , 2 ) X** ( 1 , 2 )
  • Cross With Power
      ( 1 , 2 ) X** ( 1 , 2 ) 1 , 1 , 2 , 4
  • Metaops
      >> [ ] [ ] X Z S
  • Zip
      .zipwith() Z
  • Zip
      ( 1 .. 10 ) Z < a .. j > < 1a 2b 3c 4d 5e 6f ...>
  • Zip
      for @a Z @b -> $a , $b {
  • Zip
      ( 1 .. 4 ) Z+ ( 1 .. 4 )
  • Zip
      ( 1 .. 4 ) Z+ ( 1 .. 4 ) 2 , 4 , 6 , 8
  • Metaops
      >> [ ] [ ] X Z S
  • Sequence
      .sequence S
  • __END__ ?
  • =begin END
  • Danke