to elaborate further
this:
class Point: def __init__(self, x, y): self.x = x self.y = y def inverted(self): return Point(self.y,self.x)
could be translated to
class Point; sub INIT($X,$Y) { $$x = $X; $$y = $Y; # or $self->{y} = $Y; } sub inverted { return Point($$y,$$x) # or Point->new($$y,$$x) # or Point->new($self->{y},$self->{x}) # or Point($self->{y},$self->{x}) # ... TIMTOWTDI }
People comming from Python would instantly feel at home and little by little discover more elaborated possibilities by using :attributes.
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
FootballPerl is like chess, only without the dice
In reply to Re^2: Recap: The Future of Perl 5 (backwards comaptibility, RFC)
by LanX
in thread Recap: The Future of Perl 5
by Ovid
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |