Lightning flashed, thunder crashed and Perl6 RFC Librarian [EMAIL PROTECTED]
whispered:
| =head1 TITLE
|
| Builtins: zip() and unzip()
|
[snip]
|
| its arguments. Cunzip($list_size, \@list) would reverse this operation.
|
[snip]
|
| If the list to be unzipped is not an exact multiple of the
Lightning flashed, thunder crashed and "Jeremy Howard" [EMAIL PROTECTED] whispered:
| @unzipped_list2 should not be([X,Y,Z], [A,B,C], [M]). The RFC's proposed
| behaviour makes it work as the inverse of zip(), which is the desired
| behaviour.
The reason I used letters instead of the actual
In message [EMAIL PROTECTED]
Graham Barr [EMAIL PROTECTED] wrote:
On Fri, Aug 11, 2000 at 03:30:28PM -, Perl6 RFC Librarian wrote:
In order to reverse this operation we need an Cunzip function:
@zipped_list = zip(\@a,\@b); # (1,2,3,4,5,6)
@unzipped_list = unzip(3,
Damian Conway [EMAIL PROTECTED] writes:
Just to point out that the standard CS term is "merge".
`merge' produces a list of items from 2 (or more) lists of items;
`zip' produces a list of pairs (or tuples) of items from 2 (or more)
lists of items. So in a language like Haskell which uses
Ariel Scolnicov wrote:
Damian Conway [EMAIL PROTECTED] writes:
Just to point out that the standard CS term is "merge".
`merge' produces a list of items from 2 (or more) lists of items;
`zip' produces a list of pairs (or tuples) of items from 2 (or more)
lists of items. So in a language
Nathan Wiger wrote:
"David L. Nicol" wrote:
These things sound like perfectly reasonable CPAN modules.
What's the block prevenenting their implementation w/in the
perl5 framework?
Jeremy and I are working on a general purpose matrix/unmatrix function
that may well be core-worthy. This
Nathan Wiger wrote:
With zip/unzip/partition
I really gotta say, those functions *need* to be renamed, for a variety
of reasons. First, they have well-established computer meanings
(compression, disks). Second, "partition" is too long anyways.
I've seen numerous emails from other people
* Jeremy Howard ([EMAIL PROTECTED]) [13 Aug 2000 17:28]:
[...]
Personally, I like 'weave' rather than 'zip'. I'm happy with 'unweave'
too--although I'm still unsure about that one...
Weave is too much like Knuth's tangle and weave pair of programs for his
WEB idea. *sigh* All the good names
On Sun, Aug 13, 2000 at 06:54:10PM +1000, iain truskett wrote:
* Jeremy Howard ([EMAIL PROTECTED]) [13 Aug 2000 17:28]:
[...]
Personally, I like 'weave' rather than 'zip'. I'm happy with 'unweave'
too--although I'm still unsure about that one...
Weave is too much like Knuth's tangle and
* Jarkko Hietaniemi ([EMAIL PROTECTED]) [14 Aug 2000 00:15]:
On Sun, Aug 13, 2000 at 06:54:10PM +1000, iain truskett wrote:
* Jeremy Howard ([EMAIL PROTECTED]) [13 Aug 2000 17:28]:
[...]
Personally, I like 'weave' rather than 'zip'. I'm happy with
'unweave' too--although I'm still unsure
Just to point out that the standard CS term is "merge".
I guess the opposite would be..."emerge"???
Damian
Subject: RFC 90 (v1) Builtins: zip() and unzip()
I just don't like the name zip(), unzip() - shold be saved for something
that will really do commpression.
Variants : combine
I like merge too..
As of this it will be good if there some sort of compression internally
by the perl, say
what about (not zip() offcource :")):
@a = (1,2,3);
@b = (4,5,6);
@c = (7,8,9);
zip (how,@a,@b,@c);
i.e.
@list = zip (0,@a,@b,@c); #stright
result (1,2,3,4,5,6,7,8,9)
@list = zip (1,@a,@b,@c); #reverse
result (7,8,9,5,6,7,1,2,3)
@list = zip(2,@a,@b,@c); # all first elems, then all
I simply can't get over the feeling that the proposed
zip/unzip/partition functions are far too specialized/simple, and that
something more general-purpose in the order of pack/unpack (with the
transformation spec encoded in a template) for lists would be preferable.
When someone said that
Jarkko Hietaniemi wrote:
I simply can't get over the feeling that the proposed
zip/unzip/partition functions are far too specialized/simple,
That's certainly a possibility. They are such common operations though, it
might be a win to build them in. With zip/unzip/partition and good array
With zip/unzip/partition
I really gotta say, those functions *need* to be renamed, for a variety
of reasons. First, they have well-established computer meanings
(compression, disks). Second, "partition" is too long anyways.
I've seen numerous emails from other people saying the same thing. If
On Fri, Aug 11, 2000 at 03:30:28PM -, Perl6 RFC Librarian wrote:
=head1 ABSTRACT
It is proposed that two new functions, Czip, and Cunzip, be added to
Perl. Czip(\@list1, \@list2, ...) would return a list that interleaved
its arguments. Cunzip($list_size, \@list) would reverse this
I know other languages call it zip, but personally I dislike
that name as zip() is commonly used with reference to compression.
Ditto, I really dislike zip() and unzip(). They're PC and even UNIX
commands on several platforms now, increasing confusion.
Here's two names: mix() and unmix().
On Fri, Aug 11, 2000 at 10:06:38AM -0700, Nathan Wiger wrote:
I know other languages call it zip, but personally I dislike
that name as zip() is commonly used with reference to compression.
Ditto, I really dislike zip() and unzip(). They're PC and even UNIX
commands on several platforms
I know other languages call it zip, but personally I dislike that name
as zip() is commonly used with reference to compression. Although
I do not have a good alternative.
fold() and unfold()?
merge() and cleave()?
A
On 11 Aug 2000, Perl6 RFC Librarian wrote:
its arguments. Cunzip($list_size, \@list) would reverse this operation.
[...]
In order to reverse this operation we need an Cunzip function:
@zipped_list = zip(\@a,\@b); # (1,2,3,4,5,6)
@unzipped_list = unzip(3, \@zipped_list); #
Andy Wardley wrote:
cleave()?
Note that cleave is its own antonym! :-)
--
John Porter
On Fri, Aug 11, 2000 at 06:25:07PM +0100, Andy Wardley wrote:
I know other languages call it zip, but personally I dislike that name
as zip() is commonly used with reference to compression. Although
I do not have a good alternative.
fold() and unfold()?
People would confude that for
Andy Wardley wrote:
I know other languages call it zip, but personally I dislike that name
as zip() is commonly used with reference to compression. Although
I do not have a good alternative.
fold() and unfold()?
merge() and cleave()?
A
collate() and ...?
Damian Conway wrote:
Note that cleave is its own antonym! :-)
I can see it now:
@interspersed = cleave(@list1, @list2, @list3)
@separated= cleave(3,@interspersed);
Now *that's* DWIM! ;-)
In fact, perl really only needs one OP:
@results = dwim $stuff,
Note that cleave is its own antonym! :-)
I can see it now:
@interspersed = cleave(@list1, @list2, @list3)
@separated= cleave(3,@interspersed);
Now *that's* DWIM! ;-)
Damian
In fact, perl really only needs one OP:
@results = dwim $stuff, @args, %hey;
(Well, I guess that's two: the assignment is an op also.)
dwim @results, dwim $stuff, @args, %hey;
Can you say 'Lisp'?
Damian
On Sat, Aug 12, 2000 at 07:22:01AM +1000, Damian Conway wrote:
dwim @results, dwim $stuff, @args, %hey;
Can you say 'Lisp'?
Lithp
Michael (who couldn't resist)
--
Administrator www.shoebox.net
Programmer, System Administrator www.gallanttech.com
--
Philip Newton wrote:
Would it not be more natural to pass the *number* of lists to unzip,
rather than the desired length? This way, unzip() would know to pick off
elements two-at-a-time, three-at-a-time, etc., rather than having to go
through the zipped list, count the elements, divide by
29 matches
Mail list logo