Re: PDL-P: Re: Reduce [was: Re: Random items (old p5p issues)]

2000-08-05 Thread Ariel Scolnicov
Tuomas Lukka [EMAIL PROTECTED] writes: On 4 Aug 2000, Ariel Scolnicov wrote: Karl Glazebrook [EMAIL PROTECTED] writes: OK I will raise to the bait I think it's a bit unfair to say that PDL people have failed to 'bite', there was quite a bit of discussion on our list after

Re: Reduce [was: Re: Random items (old p5p issues)]

2000-08-04 Thread Martyn Pearce
On Fri, Aug 04, 2000 at 08:16:17AM +1000, Jeremy Howard wrote: Martyn J. Pearce wrote: ... what I would like to discuss adding to the language is 1) a means to signal an early exit to the iterator, 2) a means to tell we're at the end of a list without having to evaluate the list length

Re: PDL-P: Re: Reduce [was: Re: Random items (old p5p issues)]

2000-08-04 Thread Karl Glazebrook
OK I will raise to the bait I think it's a bit unfair to say that PDL people have failed to 'bite', there was quite a bit of discussion on our list after your post. Also some concern about how much of perl6 is vapourware. I am game to take part in discussions. It has always been apparent to

Re: PDL-P: Re: Reduce [was: Re: Random items (old p5p issues)]

2000-08-04 Thread Karl Glazebrook
Also on the issue of loop unrolling and efficient looping. PDL has what we call 'threading'. This allows a C-level function to specify the dimensionality of the arguments it accepts. For example a function addtoline() which hyptheticaly adds a constant to a row vector might have a 'signature'

Re: PDL-P: Re: Reduce [was: Re: Random items (old p5p issues)]

2000-08-04 Thread Tim Jenness
On Fri, 4 Aug 2000, Tuomas Lukka wrote: On 4 Aug 2000, Ariel Scolnicov wrote: Well, first of all, 10:100, 30:200 is not the same: in Perl it comes out as 10..100, 30..200 10, 11, ... , 100, 30, 31, .., 200 Additionally, generically it would not necessarily

Re: Reduce [was: Re: Random items (old p5p issues)]

2000-08-03 Thread Graham Barr
On Wed, Aug 02, 2000 at 07:36:09PM +0100, Tom Hughes wrote: In message [EMAIL PROTECTED] Gisle Aas [EMAIL PROTECTED] wrote: The upcoming Python (v2.0) introduces a builtin called zip() that does the same thing: for a,b,c in zip(aa,bb,cc): ... There are also

Re: Reduce [was: Re: Random items (old p5p issues)]

2000-08-03 Thread Graham Barr
On Thu, Aug 03, 2000 at 06:31:38AM +, Martyn J. Pearce wrote: And I feel that by being able to iterate over lists with map, grep, fold[rl]/reduce{,_r}, whatever, _without pre-flattening the list_, we could drastically increase the applicability of these constructs. Having iterators

Re: Reduce [was: Re: Random items (old p5p issues)]

2000-08-03 Thread Jeremy Howard
Graham Barr said: ... So there probably should be an RFC to add iterators to the language and be avaliable from perl, not just C. But I have no idea how they should look etc. More generally, I wonder whether there should be an RFC on the changes required to make perl a more friendly

Re: Reduce [was: Re: Random items (old p5p issues)]

2000-08-03 Thread John Porter
Graham Barr wrote: I was simply repeating a conversation. I was not implying any name. If many other languages call it zip() then lets call it zip() No, we can't call it zip, because that's what python calls it; and that would make perl equivalent to python.* [*being facetious. hopefully

Re: Expanding the language primitives (was: Re: Reduce [was: Re: Random items (old p5p issues)])

2000-08-03 Thread Johan Vromans
Dan Sugalski [EMAIL PROTECTED] writes: More importantly, the more primitives that perl provides, the wilder and more useful things people will be able to do. Not quite. Its the functions that are provided that matter, not whether they are primitives or not[1]. A small set of primitives with a

Re: Reduce [was: Re: Random items (old p5p issues)]

2000-08-02 Thread Graham Barr
On Tue, Aug 01, 2000 at 10:27:08PM +0300, Ariel Scolnicov wrote: multimap operation list-of-lists # uurgh. This made me think of something else that came up in a discussion with Larry after the conference. The discussion started off with the ability to do for ($a,$b) (@list) { ... }

Re: Reduce [was: Re: Random items (old p5p issues)]

2000-08-02 Thread raptor
hi, Why not some sort of functionality like LISP/Prolog i.e. working with lists. ("a",@x,"b",%y) - the list head ("a",@x,"b",%y) # "a" head(tile("a",@x,"b",%y)) #@x head(head(tile("a",@x,"b",%y))) #$x[0] head(tile(tile("a",@x,"b",%y))) #"b" if you like it then "splice" etc...

Re: Random items (old p5p issues)

2000-08-02 Thread Johan Vromans
Dan Sugalski [EMAIL PROTECTED] writes: continuations, generators and co-routines. Could someone point me to a reference on these, please? My CS text collection's rather spotty and doesn't cover this stuff. The Icon Programming Language Ralph E. Griswold, Madge T. Griswold

Re: Reduce [was: Re: Random items (old p5p issues)]

2000-08-02 Thread John Porter
Graham Barr wrote: But then went onto interators and something like @list = interleave(@a,@b,@c); which would interleave the lists given, and foreach ($a,$b,$c) (interleave(@a,@b,@c)) sub interleave(\@;\@\@\@\@\@\@\@\@) { my $m = -1; for ( @_ ) { $m $#{$_}

Re: Reduce [was: Re: Random items (old p5p issues)]

2000-08-02 Thread Graham Barr
On Wed, Aug 02, 2000 at 10:43:37AM -0600, Tom Christiansen wrote: sub mapf(;\@\@\@\@\@\@\@\@\@) { Steal from lisp: map maap maaap mapp mappp maappp dwim :) Graham.

Re: Reduce [was: Re: Random items (old p5p issues)]

2000-08-02 Thread Hildo Biersma
Tom Christiansen wrote: sub mapf(;\@\@\@\@\@\@\@\@\@) { Steal from lisp: map maap maaap mapp mappp maappp ... Should be feasible with an AUTOLOAD that takes a certain kind of regular expression... sub AUTOLOAD /^ma+p+$/ { } Some for the 'car' and

Re: Reduce [was: Re: Random items (old p5p issues)]

2000-08-02 Thread Glenn Linderman
Graham Barr wrote: The upcoming Python (v2.0) introduces a builtin called zip() that does the same thing: for a,b,c in zip(aa,bb,cc): ... There are also question on how long the resulting list should be if @a, @b, @c is not of the same length. I think zip() was defined

Re: Reduce [was: Re: Random items (old p5p issues)]

2000-08-02 Thread Tom Hughes
In message [EMAIL PROTECTED] Gisle Aas [EMAIL PROTECTED] wrote: The upcoming Python (v2.0) introduces a builtin called zip() that does the same thing: for a,b,c in zip(aa,bb,cc): ... There are also question on how long the resulting list should be if @a, @b, @c is not

Re: Reduce [was: Re: Random items (old p5p issues)]

2000-08-02 Thread Simon Cozens
On Wed, Aug 02, 2000 at 12:22:10PM -0400, John Porter wrote: sub interleave(\@;\@\@\@\@\@\@\@\@) { ... } sub mapf(;\@\@\@\@\@\@\@\@\@) { ... } I guess my question is, why do these need to be builtins? sub push (\@@) { @{$_[0]} = (@{$_[0]}, @_[1..@_]); } -- Addi Just imagine we

Re: Random items (old p5p issues)

2000-08-01 Thread Chaim Frenkel
And how about continuations, generators and co-routines. chaim "CF" == Chaim Frenkel [EMAIL PROTECTED] writes: CF Magic words. CF Iterators CF Reduce (e.g. $x = reduce { sum } @list; CF Case/Switch CF Make some of the unaddressable into first class objects.

Re: Random items (old p5p issues)

2000-08-01 Thread Chaim Frenkel
"PC" == Piers Cawley [EMAIL PROTECTED] writes: PC Chaim Frenkel [EMAIL PROTECTED] writes: And how about continuations, generators and co-routines. PC Now those'd be nice if they could be added without slowing down the PC rest of perl. (I didn't mention implementation) I'd consider them

Re: Random items (old p5p issues)

2000-08-01 Thread Nathan Torkington
Piers Cawley writes: Iterators Doable in perl5 already. Reduce (e.g. $x = reduce { sum } @list; Doable in perl5 Case/Switch Why? And Damian's already proved it can be done. Perl's goal is to make easy things easy. I think case/switch is something that belongs in