Warum brauchen wir eine neue Programmiersprache wie Perl 6? Haben wir nicht schon genug Programmiersprachen? Jetzt kommt Perl 6.
https://en.wikibooks.org/wiki/Perl_6_Programming/Subroutines
(* = whatever)
subset NonNegativeInt of Int where * >= 0;
sub fib (NonNegativeInt $nth) {
...
}
subset NonEmptyString of Str where *.chars > 0;
method set_name (NonEmptyString $name) {
...
}
(not static typing and not dynamic) fails at compile time
sub foo (Int $n) { ... }
my Num $bar = 3;
foo($bar);
if .1 + .2 == .3 {
say "yes";
}
else {
say "no";
}
1 / ( .1 + .2 - .3 ); # results in 1/0 and not in error
class Point {
subset PointLimit of Rat wehre -10,0 .. 10.0;
has PointLimit $.x is rw is required;
has PointLimit $.y is rw is required;
}
http://blogs.perl.org/users/ovid/2015/09/fluent-interfaces-in-perl-6.html
use JSON::Tiny;
sub MAIN($file1,$file2) {
my $parsing1 = start form-json(slurp($file 1));
my $parsing2 = start form-json(slurp($file 2));
my ($parsed1, $parsed2) = await $parsing1, $parsing2;
say $parsed1 eqv $parsed 2
?? 'Files contain identical JSON'
:: 'Files contain different JSON';
}
https://en.wikibooks.org/wiki/Perl_6_Programming/Lazy_Lists_and_Feeds
Inline::Perl5 https://github.com/niner/Inline-Perl5/
Inline (C) https://github.com/FROGGS/p6-Inline-C/
Inline::Python https://github.com/niner/Inline-Python/
Inline::Lua https://github.com/raydiak/Inline-Lua/
Perl 6 strings are NFG (Normal Form Grapheme).
https://rdstar.wordpress.com/2013/07/22/some-thoughts-on-unicode-in-perl-6/
C:\rakudo\bin>perl6 -e "say 'Hallo world!'; say 5 ~~ 1 .. 1e999999;" Hallo world! True C:\rakudo\bin>
C:\rakudo\bin>perl6 -e "say 'Hallo world!'; say 5 ~~ 1 .. 1e999999x;"
===SORRY!=== Error while compiling -e
Confused
at -e:1
------> 'Hallo world!'; say 5 ~~ 1 .. 1e999999x;
expecting any of:
whitespace
C:\rakudo\bin>
I read
https://www.quora.com/Perl-programming-language-1/Should-I-be-interested-in-Perl6/answer/Curtis-Poe
Yes of course, but it's divided in many many posts.
Let's stay with Curtis Poe for a moment, just recently he wrote this:
https://www.quora.com/Perl-programming-language-1/Why-did-Larry-Wall-finally-ship-Perl6-and-does-anybody-care/answer/Curtis-Poe?srid=OB5p&share=1
Why did Larry Wall finally ship Perl6, and does anybody care? Curtis Poe's answer:
in the Guidelines for the Perl6 page on Facebook, I mentioned some links.
Some contain answers to your question.
https://www.facebook.com/notes/perl6/guidelines-rules/1659022847697401