Perl 9 contians new datatypes/contexes!
Perl now got some new data types and contexes:
Fuzzy Context ~
Everything is not sharp but fuzzy! Fuzzy does always something like the desired value! It is never exact!
my ~fuz; # Fuzzy type
use PHP qw(Function::echo);
# You don't know if its assigning list or scalar context!
my ~fuzzy = qw(Hello mister Edd);
echo<-~fuzzy; // Can print 'Hello' or can print '3'
my ~foo = 'Good morning';
echo<-~foo; # Due a built in AI engine, this may print 'Good morning' or 'Bad afternoon'
Matrix Context []
No more limitations to list and scalar and void contexes!
my ([]matrix1,[]matrix2) = (
((1, 0, 0), (0, 1, 0), (0, 0, 1)),
((0, 1, 0), (0, 0, 1), (1, 0, 0)),
);
[]matrix1 += []matrix2; # Will add matrix2 to matrix1!
[]matrix1.say; # Will print ((1, 1, 0), (0, 1, 1), (1, 0, 1))
If you want to do multi dimensional matrices then you can do:
my [][]matrix =
(((1, 0, 0), (0, 1, 0), (0, 0, 1)),
((0, 1, 0), (0, 0, 1), (1, 0, 0)),
((0, 1, 0), (0, 0, 1), (1, 0, 0)));
etc...