Second use of flattening

1 view
Skip to first unread message

Terrence Brannon

unread,
Apr 4, 2005, 2:45:34 PM4/4/05
to perl6-l...@perl.org
The first discussion of flattening had to do with a list of data being
flattened into an array.

Further down we see another different use of the word "flattening" :

<quote
src=http://dev.perl.org/perl6/synopsis/S06.html
section="Flattening lists">

The unary prefix operator * flattens its operand (which allows the
elements of an array or iterator to be used as an argument list).

</quote>

Here I understand this to mean that the array is spreading or
distributing its elements to individual scalars.

So, to avoid confusion with the common understanding of flattening in
Perl, perhaps it should be called spreading or distributing.

Juerd

unread,
Apr 4, 2005, 6:34:31 PM4/4/05
to Terrence Brannon, perl6-l...@perl.org
Terrence Brannon skribis 2005-04-04 18:45 (+0000):

> So, to avoid confusion with the common understanding of flattening in
> Perl, perhaps it should be called spreading or distributing.

I agree.

Likewise, "slurping" is probably best explained as collecting.


Juerd
--
http://convolution.nl/maak_juerd_blij.html
http://convolution.nl/make_juerd_happy.html
http://convolution.nl/gajigu_juerd_n.html

Andrew Rodland

unread,
Apr 4, 2005, 10:34:13 PM4/4/05
to perl6-l...@perl.org
On Monday 04 April 2005 06:34 pm, Juerd wrote:
> Terrence Brannon skribis 2005-04-04 18:45 (+0000):
> > So, to avoid confusion with the common understanding of flattening in
> > Perl, perhaps it should be called spreading or distributing.
>
> I agree.
>
> Likewise, "slurping" is probably best explained as collecting.

I like this. I'd be tempted to suggest "scatter" / "gather", but that's
probably a bit opaque to the average reader. How about describing them as
"expand" / "collect" for a matched pair? That's got a legacy in math, and
some mathematically-oriented languages.

Andrew

Larry Wall

unread,
Apr 5, 2005, 2:59:10 AM4/5/05
to perl6-l...@perl.org
On Mon, Apr 04, 2005 at 10:34:13PM -0400, Andrew Rodland wrote:

We chose "slurp" for several good reasons, including the fact that it
isn't currently overloaded N ways from Sunday, and it has a decent
adjectival form that you can talk about parameters with. And if
you're going to make up a new technical term, it doesn't really need
to have any legacy at all, as long as the metaphor works, and the
Huffman coding is right. In fact, sometimes we intentionally go
against existing legacy, like when we named "roles". Sometimes we
go with the legacy, such as with "flatten".

I don't want to discourage people from brainstorming about the
terminology, but you have to recognize that the design team has been
banging its collective head against these issues for years now.
Damian in particular is a stickler for good terminology. So you
*might* offhandedly come up with something better than we've thought
of already, but please realize it's a long shot. Most of these words
were rather firmly lodged into their metastable states even before
the Apocalypses came out--let alone the Exegeses and Synopses--so
you'll have to whack 'em pretty hard to knock any of 'em loose.

Larry

Juerd

unread,
Apr 5, 2005, 2:57:57 AM4/5/05
to Andrew Rodland, perl6-l...@perl.org
Andrew Rodland skribis 2005-04-04 22:34 (-0400):

> > Likewise, "slurping" is probably best explained as collecting.
> I like this. I'd be tempted to suggest "scatter" / "gather", but that's

Gather is taken.

> probably a bit opaque to the average reader. How about describing them as
> "expand" / "collect" for a matched pair? That's got a legacy in math, and
> some mathematically-oriented languages.

It having meaning in maths is probably more a reason not to use, unless
the meaning is identical enough.

Reply all
Reply to author
Forward
0 new messages