190 karma · joined July 18, 2012
I hardly ever use shift like this, preferring instead the more readable argument copying:
sub PaintHouse {
my ($house, $color) = @_;
...https://github.com/BurntSushi/ripgrep/issues/875#issuecommen...
"Program to an interface, not an implementation"
and this actually comes before the other one about composition.
Inheritance (i.e. implementation inheritance) creates tight coupling between classes, whereas interfaces exist to prevent that happening, ... they are quite different constructs.
The original vision for Perl6 included a runtime called Parrot which would have been capable of running both Perl6 and Perl5.
If Parrot had been realised, Perl6(Raku) and Perl5 would have been able to interop similar to how Java and the other JVM languages can.
But without that, Raku and Perl remain incompatible so e.g. the existing large Perl ecosystem can't be leveraged from Raku.
https://thenewstack.io/larry-walls-quest-100-year-programmin...
There's one chapter that uses Python, but that's just to show how a TDD framework could be implemented in a language which (at that time) didn't have one.
pirl @> sub hats : lvalue { my ($self) = @_; $self->{hats}; }
@var = ();
pirl @> $obj = bless {}
@var = (
bless( {}, 'Shell::Perl::sandbox' )
);
pirl @> $obj->hats
@var = (
undef
);
pirl @> $obj
@var = (
bless( {}, 'Shell::Perl::sandbox' )
);
pirl @> $obj->hats = 1
@var = (
1
);
pirl @> $obj
@var = (
bless( {
'hats' => 1
}, 'Shell::Perl::sandbox' )
);
pirl @> $obj->hats
@var = (
1
);
pirl @> $obj->hats++
@var = (
1
);
pirl @> $obj->hats
@var = (
2
);
pirl @>Now if I could only find something similar for learning piano.
No, percussion (meter) has it's own framework called Taala [1], which is orthogonal to Raaga.
As a concrete example: Raaga Hamsadhwani in Rupak Taala (7 beats) [2] vs Teental (16 beats) [3]
[1] https://en.wikipedia.org/wiki/Tala_(music)
The article for whales [1] linked from that sentence says "They are an informal grouping within the infraorder Cetacea, usually excluding dolphins and porpoises."
> Be careful though: not everything from evangelists will apply to your specific problem. Don’t invoke the Single Responsibility Principle spell without any argument why it’s useful and valid. Opinion leaders should provide you these concrete arguments; if they don’t, their names alone shouldn’t influence your decisions.
First, Perl will support multiple syntaxes that map onto a single semantic model. Second, that single semantic model will in turn map to multiple platforms.
Multiple syntaxes sound like an evil thing, but they're really necessary for the evolution of the language. To some extent we already have a multi-syntax model in Perl 5; every time you use a pragma or module, you are warping the language you're using. As long as it's clear from the declarations at the top of the module which version of the language you're using, this causes little problem.
There were even plans for a translator [2] similar to Python's 2to3 tool
Larry Wall and others are already working on a Perl 5 to Perl 6 translator, which will be able to translate (most) Perl 5 source code to the equivalent Perl 6 syntax.
In addition, Perl 6 will provide a "Perl 5 compatibility mode", allowing the compiler to directly execute any code that it recognizes as being written in Perl 5.
https://worldbuilding.stackexchange.com/questions/18757/what...
Some sample code (I modified it to be commutative on the argument types):
https://gist.github.com/arunbear/caef7546d297c01fddbd3f67117...
Guido's post on multimethods: https://www.artima.com/weblogs/viewpost.jsp?thread=101605
Clojure style multimethods: https://adambard.com/blog/implementing-multimethods-in-pytho...
?- yet_another_prolog('yap.chat').
false.
?-
This reminded me of the Prolog of the same name (it's website seems to be in limbo).