Perl6 Language perl6: ARE WE THEEEEERE YET? Don't make me pull this community over. we're not there yet but we're much closer we have most of the core components of the language design in place ...especially the OO components here's what's new: this years'c concat operator... ...is still tilde! there's a pipeline (we had this last year, didn't we?) not just syntactic sugar, syntactic vitamins forces rhs of <== into slurpy array parameter and are reverseable will work with lazy lists fat comma now produces pairs useful for passing named arguments but now there's a second way: :identifier(value) (more use for the colon!) no commas needed between elements omit (value) if the value is just TRUE omit the parens and just use << >> if value is a string omit the parens and use [] or {} or (something) for array, block, or hash say function: equiv to print with a newline at the end slurp function: $text = slurp $filehandle; $text = slurp $filename; ( lost some notes; iTerm weirdness ) OO is now declarative class keyword that isn't package or module followed by a block that delimits the class definition can just be ... attributes are variables with a dot ebtween sigil and name specified with has keyword for example class DogTag { has Str $.name; has Rank $.rank; has Event @.record is rw; ... } with defaults: has Int $.serial_num = { get_snum() }; accessor methods are created for attribuets automatically is read-only unless attribute "is rw" rw attribute accessors are lvalue private attribuets use : instead of . has Base $:posting is rw; if method prototype has "$self:" (with trailing colon) that var gets the invocant not always needed: $.attr is fine without $self inside method code indirect object syntax is still supported, but the object being called now must have a trailing colon $result = method $object: $arg1, $arg2 method dispatch is always polymorphic (as in perl5) the topic is always the invocant, even if you have no $self: in prototype ...and the method call operator is prefix unary $_.foo(@args) can be written as .foo(@args) so it looks like C++ but you can tell a subroutine from a method! static inheritance between classes class Dog is Animal { ... } can be internal: class Dog { is Animal; ... } derived classes inherit all the attribuets of ancestors but privacy denies it submethods! a submethod is a method that /is not inherited/ all classes inherit C and C from universal somewhere .= <-- call method on lhs $foo = $foo.reset is $foo .= reset is $foo.=reset on creation calls BUILD submethod on all classes there's also CREATE -- didn't get the explanation Roles in most OO languages classes serve as both types and components (mixins) roles let you shove code into a class declaration as if it was a macro "a fragment of a class that can be intelligently inserted into the class that you're creating" class Vector::Identifiable { is Vector; does Identifiable; has ($.x, $.y, $.z); submethod BUILD { ... } } roles aren't classes you can't instantiate them it acts like an interface (in Java or Obj-C) fin