Skip to content

Commit

Permalink
perldelta for new :writer field attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
leonerd committed Nov 24, 2024
1 parent d95397a commit 00feec6
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions pod/perldelta.pod
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,20 @@ here, but most should go in the L</Performance Enhancements> section.

[ List each enhancement as a =head2 entry ]

=head2 New C<:writer> attribute on field variables

Classes defined using C<use feature 'class'> are now able to automatically
create writer accessors for scalar fields, by using the C<:writer> attribute,
similar to the way that C<:reader> already creates reader accessors.

class Point {
field $x :reader :writer :param;
field $y :reader :writer :param;
}

my $p = Point->new( x => 20, y => 40 );
$p->set_x(60);

=head1 Security

XXX Any security-related notices go here. In particular, any security
Expand Down

0 comments on commit 00feec6

Please sign in to comment.