Re: RFC 90 (v1) Builtins: zip() and unzip()

2000-08-15 Thread Stephen P. Potter
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

Re: RFC 90 (v1) Builtins: zip() and unzip()

2000-08-15 Thread Stephen P. Potter
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

Re: RFC 90 (v1) Builtins: zip() and unzip()

2000-08-14 Thread Tom Hughes
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,

Re: RFC 90 (v1) Builtins: zip() and unzip()

2000-08-14 Thread Ariel Scolnicov
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

Re: RFC 90 (v1) Builtins: zip() and unzip()

2000-08-14 Thread Jeremy Howard
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

Re: RFC 90 (v1) Builtins: zip() and unzip()

2000-08-14 Thread Jeremy Howard
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

Re: RFC 90 (v1) Builtins: zip() and unzip()

2000-08-13 Thread Jeremy Howard
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

Re: RFC 90 (v1) Builtins: zip() and unzip()

2000-08-13 Thread iain truskett
* 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

Re: RFC 90 (v1) Builtins: zip() and unzip()

2000-08-13 Thread Jarkko Hietaniemi
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

Re: RFC 90 (v1) Builtins: zip() and unzip()

2000-08-13 Thread iain truskett
* 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

Re: RFC 90 (v1) Builtins: zip() and unzip()

2000-08-13 Thread Damian Conway
Just to point out that the standard CS term is "merge". I guess the opposite would be..."emerge"??? Damian

Re: RFC 90 (v1) Builtins: zip() and unzip()

2000-08-12 Thread raptor
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

Re: RFC 90 (v1) Builtins: zip() and unzip()

2000-08-12 Thread raptor
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

Re: RFC 90 (v1) Builtins: zip() and unzip()

2000-08-12 Thread Jarkko Hietaniemi
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

Re: RFC 90 (v1) Builtins: zip() and unzip()

2000-08-12 Thread Jeremy Howard
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

Re: RFC 90 (v1) Builtins: zip() and unzip()

2000-08-12 Thread Nathan Wiger
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

Re: RFC 90 (v1) Builtins: zip() and unzip()

2000-08-11 Thread Graham Barr
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

Re: RFC 90 (v1) Builtins: zip() and unzip()

2000-08-11 Thread Nathan Wiger
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().

Re: RFC 90 (v1) Builtins: zip() and unzip()

2000-08-11 Thread Jarkko Hietaniemi
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

Re: RFC 90 (v1) Builtins: zip() and unzip()

2000-08-11 Thread Andy Wardley
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

Re: RFC 90 (v1) Builtins: zip() and unzip()

2000-08-11 Thread Philip Newton
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); #

Re: RFC 90 (v1) Builtins: zip() and unzip()

2000-08-11 Thread John Porter
Andy Wardley wrote: cleave()? Note that cleave is its own antonym! :-) -- John Porter

Re: RFC 90 (v1) Builtins: zip() and unzip()

2000-08-11 Thread Graham Barr
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

Re: RFC 90 (v1) Builtins: zip() and unzip()

2000-08-11 Thread Brad Hughes
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 ...?

Re: RFC 90 (v1) Builtins: zip() and unzip()

2000-08-11 Thread John Porter
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,

Re: RFC 90 (v1) Builtins: zip() and unzip()

2000-08-11 Thread Damian Conway
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

Re: RFC 90 (v1) Builtins: zip() and unzip()

2000-08-11 Thread Damian Conway
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

Re: RFC 90 (v1) Builtins: zip() and unzip()

2000-08-11 Thread Michael Fowler
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 --

Re: RFC 90 (v1) Builtins: zip() and unzip()

2000-08-11 Thread Jeremy Howard
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