[Haskell-cafe] The functional-object style seems to be gaining
momentum.
Alexander Solla
ajs at 2piix.com
Fri Jun 18 17:51:42 EDT 2010
On Jun 18, 2010, at 2:36 PM, Alexander Solla wrote:
> Package Number;
> sub new { my $class = shift; my $self = shift; bless $self, $class;
> return $self; }
> sub plus arg { return $self + arg; }
> sub minus arg { return $self - arg }
Syntax errors in my Perl (sorry, the last time I did Perl seriously,
we used an extension for named arguments)
sub new { my $class = shift; my $self = shift; bless $self, $class;
return $self; }
sub plus { my ($self, $arg) = @_; return $self + $arg; }
sub minus { my ($self, $arg) = @_; return $self - $arg; }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20100618/515ab3f4/attachment.html
More information about the Haskell-Cafe
mailing list