News for hackers. Stuff that matters.
Re:The Future of Perl by orf on Friday March 10, 2023 @09:36PM (#35104546)
A simple point class looks like this:

  class Point {
      has [qw/x y/] => ( default => sub { 0 } );

      sub clear ($self) {
          $self->@{ 'x', 'y' } = ( 0, 0 );
      }
  }
What?
Re:The Future of Perl by sarabob on Saturday March 11, 2023 @05:57AM (#35107227)
Not quite - that was his initial implementation which he described as "That’s not good at all, but I was trying to work within Perl’s limitations". The corinna syntax is

  class Point {
    field ( $x, $y ) :param = 0;

    method clear () {
      ( $x, $y ) = ( 0, 0 );
    }
  }
Re:The Future of Perl by rurban on Sunday March 12, 2023 @03:09PM (#35124742)
Maybe he meant

  class Point {
      has $x = 0;
      has $y = 0;

      sub clear {
          $x = $y = 0;
      }
  }
At least that's how I implemented it in the future perl, called cperl. Designed with perl6. His perl cannot have array or hash fields, and his fields are still hash keys. Wtf
Re:The Future of Perl by uhtred on Wednesday March 15, 2023 @09:43AM (#35168212)
who cares about classes though? OOP is literally the most boring thing in programming, and the stuff Perl is awesome at doesn't require OOP.

If you want classes go use java or C#, the second and third most boring things in programming.