A Perl 5 user thinks of flattening a data structure as taking
something which is nested and "linearizing" it.

FOR EXAMPLE:

 use Data::Hash::Flatten;

  # NESTED DATA
  my $a = { bill => { '5/27/96' => { 'a.dat' => 1, 'b.txt' => 2,
  'c.lsp' => 3 } },
            jimm => { '6/22/98' => { 'x.prl' => 9, 'y.pyt' => 8,
            'z.tcl' => 7 } } } ;


  my @a = Data::Hash::Flatten->this($a, [qw(name date file)]);
  
  use Data::Dumper;
  print Dumper([EMAIL PROTECTED]);

  # FLATTENED DATA
  $VAR1 = [
          {
            'date' => '6/22/98',
            'name' => 'jimm',
            'file' => 'z.tcl'
          },
          {
            'date' => '6/22/98',
            'name' => 'jimm',
            'file' => 'y.pyt'
          },
          {
            'date' => '6/22/98',
            'name' => 'jimm',
            'file' => 'x.prl'
          },
          {
            'date' => '5/27/96',
            'name' => 'bill',
            'file' => 'c.lsp'
        

HERE'S ANOTHER EXAMPLE:

@ary = (@a,@b,@c);

All three arrays are not nested into @ary, but flattened into @ary.

TO SUMMARIZE:

flatten means something particular to Perl 5 users and the usage of
the term "flatten" in http://dev.perl.org/perl6/synopsis/S06.html
has no relation to its previously understood meaning.

A more accurate term might be generated or reified, because the
abstract, existent-only-in-conception list members are
concretized/generated/reified via slurping.


SUGGESTIONS:

Change this

<quote>
Slurpy parameters are treated lazily -- the list is only flattened
into an array when individual elements are actually accessed:

        @fromtwo = tail(1..Inf);        # @fromtwo contains a lazy [2..Inf]

</quote>

To this:

<quote>
Slurpy parameters are treated lazily -- the list is only
concretized/generated/realized/reified/actualized
into an array when individual elements are actually accessed:

        @fromtwo = tail(1..Inf);        # @fromtwo contains a lazy [2..Inf]

</quote>


Change this:

<quote>
Flattening argument lists
</quote>

to this:

<quote>
Actualizing argument lists
</quote>

Reply via email to