Skip to content

Commit

Permalink
structs come as either values or objects
Browse files Browse the repository at this point in the history
The treatement of a compact struct as a value or as an
object depends on whether there are mutators.
  • Loading branch information
Larry Wall committed Jan 5, 2011
1 parent 167354e commit 9259016
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions S09-data.pod
Expand Up @@ -13,8 +13,8 @@ Synopsis 9: Data Structures

Created: 13 Sep 2004

Last Modified: 23 Sep 2010
Version: 49
Last Modified: 4 Jan 2011
Version: 50

=head1 Overview

Expand Down Expand Up @@ -154,9 +154,10 @@ how to lay them out in memory, possibly with a pack/unpack format
associated with the class, or with the strange elements of the class,
or with the types under which the strange element is declared.

Note that a compact struct is itself a value type, so except for
Note that a compact struct that has no mutators is itself a value type, so except for
performance considerations, it doesn't matter how many representations
of it there are in memory as long as those are consistent.
of it there are in memory as long as those are consistent. On the other
hand, structs with mutators must behave more like normal mutable objects.

The packing serialization is performed by coercion to an appropriate
buffer type. The unpacking is performed by coercion of such a buffer
Expand Down

0 comments on commit 9259016

Please sign in to comment.