Re: Support for ensuring invariants from one loop iteration to the next?

2008-12-16 Thread David Green
On 2008-Dec-16, at 6:21 pm, Timothy S. Nelson wrote: Or, instead of having a new block, just add the iterator indicator to the NEXT block, and get rid of ENTER and LEAVE. That way, you'd have this sequence: - FIRST {} - NEXT 0 {} # Replaces ENTER - NEXT 1..* {} # Does NOTF

Re: 6PAN idea

2008-12-16 Thread Timothy S. Nelson
On Tue, 16 Dec 2008, Brandon S. Allbery KF8NH wrote: On 2008 Dec 16, at 23:00, Timothy S. Nelson wrote: One thing I've been working on recently is a (Perl 5) object that models package metadata. In theory, it should be able to model the metadata from a .rpm, a .deb, a CPAN package, or whatev

Re: 6PAN idea

2008-12-16 Thread Brandon S. Allbery KF8NH
On 2008 Dec 16, at 23:00, Timothy S. Nelson wrote: One thing I've been working on recently is a (Perl 5) object that models package metadata. In theory, it should be able to model the metadata from a .rpm, a .deb, a CPAN package, or whatever. Then you read the data using a "metadata input

Re: r24325 - docs/Perl6/Spec

2008-12-16 Thread Patrick R. Michaud
On Mon, Dec 15, 2008 at 11:18:54PM -0500, Mark J. Reed wrote: > On Mon, Dec 15, 2008 at 5:41 PM, Moritz Lenz wrote: > > I know at least of infix:(Num $a, Num $b) (which does the same as > > Perl 5's <=>) and infix:(Pair $a, Pair $b) (which does $a.key cmp > > $a.key || $a.value cmp $b.value), so n

6PAN idea

2008-12-16 Thread Timothy S. Nelson
Hi all. I've been working on some stuff that's vaguely, tangentially CPAN-related. My basic assumption is that there's going to be some kind of packaging system written around 6PAN. One thing I've been working on recently is a (Perl 5) object that models package metadata. In theory, it

Re: Working with files wish list

2008-12-16 Thread Leon Timmermans
On Tue, Dec 16, 2008 at 7:04 AM, jason switzer wrote: > I hadn't seen a Nameable role mentioned yet, so I wasn't able to understand > any such concept. The list was not meant to be exhaustive. There are a lot more roles that have something to do with IO but were missing: Asynchronous IO, Datagram

Re: Support for ensuring invariants from one loop iteration to the next?

2008-12-16 Thread Timothy S. Nelson
On Tue, 16 Dec 2008, Jon Lang wrote: How do you compute '*'? That is, how do you know how many more iterations you have to go before you're done? In some cases, it won't have to be computed, in some cases it won't be computeable (which should be an error). I'd say it'd be fair enough to sa

Re: Support for ensuring invariants from one loop iteration to the next?

2008-12-16 Thread Jon Lang
How do you compute '*'? That is, how do you know how many more iterations you have to go before you're done? Should you really be handling this sort of thing through an "iteration count" mechanism? How do you keep track of which iteration you're on? Is it another detail that needs to be handled

Re: Support for ensuring invariants from one loop iteration to the next?

2008-12-16 Thread Timothy S. Nelson
On Tue, 16 Dec 2008, David Green wrote: On 2008-Dec-6, at 7:37 am, Aristotle Pagaltzis wrote: Funnily enough, I think you?re onto something here that you didn?t even notice: [...] if we had a NOTFIRST (which would run before ENTER just as FIRST does, but on *every* iteration *except* the first

Re: What does a Pair numify to?

2008-12-16 Thread Moritz Lenz
Jon Lang wrote: > That's a good point. Is there an easy way to distinguish between > passing a pair into a positional parameter vs. passing a value into a > named parameter? Off the top of my head, see S06 for the gory details: my $pair = a => 'b'; named(a => 'b'); named(:a); named(|$pair);

Re: Proposal: Make @a and @@a different variables

2008-12-16 Thread Moritz Lenz
TSa wrote: > HaloO, > > Daniel Ruoso wrote: >> That being said, we should note that this example looks simple because >> we have almost no lazyness implied (since there's an assignment in the >> first line), every list access requires the evaluation of the flatenning >> of the list. >> >> my @@

Re: Proposal: Make @a and @@a different variables

2008-12-16 Thread Larry Wall
I think I'm fine with making them separate. Recursive lazy flattening seems too evil; slice and list contexts should not try to do the work of captures. Thanks. Larry

Re: Resume from exception

2008-12-16 Thread Larry Wall
On Mon, Dec 15, 2008 at 03:06:44PM -0700, Stephen Weeks wrote: : do { : die 'some text'; : say 'after the exception'; : CATCH { : say 'caught the exception'; : ...; # what goes here? : } : } : : My proposal is to call .resume() on the exception object. It could jus

Re: Out of CONTROL...?

2008-12-16 Thread Larry Wall
On Mon, Dec 08, 2008 at 02:32:14PM -0600, Patrick R. Michaud wrote: : A very interesting question came up on #perl today, so I'm : forwarding it to p6l for discussion/decision. : : Given the following code: : : sub foo() { return 1; } : sub bar() { warn "oops"; } : : { :

Re: Proposal: Make @a and @@a different variables

2008-12-16 Thread Daniel Ruoso
Em Ter, 2008-12-16 às 18:47 +0100, TSa escreveu: > > # the following will require a flatenning to get the actual index > > say @a[3]; > Could we not shift the problem into a more complicated form > of the size of the array? Here it has size 0+3+0 but each of the > summands could be lazy and hen

Re: What does a Pair numify to?

2008-12-16 Thread Jon Lang
Moritz Lenz wrote: > Off the top of my head, see S06 for the gory details: > > my $pair = a => 'b'; > > named(a => 'b'); > named(:a); > named(|$pair); > > positional((a => 'b')); > positional((:a)); > positional($pair); As you say: the gory details, emphasis on gory. But if that's the way of thin

Re: What does a Pair numify to?

2008-12-16 Thread Jon Lang
TSa wrote: > I see no problem as long as say gets a pair as argument. Then it can > print the key and value separated with a tab. More problematic are > string concatenations of the form > > say "the pair is: " ~ (foo => $bar); > > which need to be written so that say sees the pair > > say "the

Re: Proposal: Make @a and @@a different variables

2008-12-16 Thread TSa
HaloO, Daniel Ruoso wrote: That being said, we should note that this example looks simple because we have almost no lazyness implied (since there's an assignment in the first line), every list access requires the evaluation of the flatenning of the list. my @@a = ((),(1,2,3),()); Mustn't th

Re: Support for ensuring invariants from one loop iteration to the next?

2008-12-16 Thread David Green
On 2008-Dec-6, at 7:37 am, Aristotle Pagaltzis wrote: Funnily enough, I think you’re onto something here that you didn’t even notice: [...] if we had a NOTFIRST (which would run before ENTER just as FIRST does, but on *every* iteration *except* the first), then we could trivially attain the

Re: What does a Pair numify to?

2008-12-16 Thread TSa
HaloO, Moritz Lenz wrote: The counter example is if you want to print a pair: .say for %hash.pairs.sort: { .value }; In that case it would be nice to have the key appear in the stringification. I see no problem as long as say gets a pair as argument. Then it can print the key and value separ

Re: What does a Pair numify to?

2008-12-16 Thread Jon Lang
On Mon, Dec 15, 2008 at 10:26 PM, Larry Wall wrote: > On Mon, Dec 15, 2008 at 04:43:51PM -0700, David Green wrote: >> I can't really think of a great example where you'd want to numify a >> pair, but I would expect printing one to produce something like "a => >> 23" (especially since that's what a

Proposal: Make @a and @@a different variables

2008-12-16 Thread Daniel Ruoso
Hi, One of the hardest features in Perl 6 is the slice context. It is undoubtfully usefull, since it provides semantics to acces each iteration of a map, for instance. But there's one thing in the spec that makes not only slices, but the lists themselves considerably harder to implement, and that

Re: Working with files wish list

2008-12-16 Thread Timothy S. Nelson
On Tue, 16 Dec 2008, jason switzer wrote: You can already easily mix it in using 'does': $fstab = open('/etc/fstab', :r); $fstab does WhitespaceTrim; I don't think it's really necessary to include that into open(), though it might be useful syntactic sugar. I haven't spent the time to unders

Re: What does a Pair numify to?

2008-12-16 Thread Larry Wall
On Mon, Dec 15, 2008 at 04:43:51PM -0700, David Green wrote: > I can't really think of a great example where you'd want to numify a > pair, but I would expect printing one to produce something like "a => > 23" (especially since that's what a one-element hash would print, > right?). Nope, wou

Re: Better "sort" spec?

2008-12-16 Thread Larry Wall
On Fri, Dec 12, 2008 at 11:49:37PM -0500, Uri Guttman wrote: : so you have not discovered something new in perl or perl6 regarding : sorting. it has been covered and in depth but never properly integrated : into the p6 docs. It will be more useful if you comment relative to the existing design fou