Newsgroups: perl.perl6.internals
From: d...@sidhe.org (Dan Sugalski)
Date: Mon, 14 Jun 2004 12:53:11 -0400
Local: Mon, Jun 14 2004 12:53 pm
Subject: Slices and iterators
Since we're going to need these, and I'm in a documenting and
defining mood (yes, I am making a final decision on strings today. Whee!) I figure we need to tackle them. First, slices. Perl's got 'em, Python has them, Ruby, interestingly, @foo = ('A', 'B', 'C', 'D'); @bar is now ('A', 'C'). Or: @bar = @foo[0,0,0,0,0,0]; @bar is now ('A', 'A', 'A', 'A', 'A', 'A'). I think for this to work we need to add a slice vtable entry. Not The slice vtable entry should take as its parameter a slice pmc. This @foo[0..2,4..8,12..]; with three entries in the slice array--one with a from/to of 0/2, one This vtable entry should return an iterator, which is why they're @foo = @bar[0..]; on an array that generates data randomly we'll get caught in an Since we're working on iterators, all aggregates should be able to So, the proposal: *) We add a slice vtable entry which takes a slice pmc and returns an interator Please, let discussion ensue. We'll decide on the slice creation --------------------------------------it's like this------------------- You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||