Permalink
Browse files

structs come as either values or objects

The treatement of a compact struct as a value or as an
object depends on whether there are mutators.
  • Loading branch information...
Larry Wall
Larry Wall committed Jan 5, 2011
1 parent 167354e commit 92590165ab03e553c1465a282c546875c3039ce8
Showing with 5 additions and 4 deletions.
  1. +5 −4 S09-data.pod
View
@@ -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
@@ -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

0 comments on commit 9259016

Please sign in to comment.