Re: A suggestion for a new closure trait.

2006-08-29 Thread Sage La Torra
On 8/30/06, Jonathan Lang <[EMAIL PROTECTED]> wrote: Joe Gottman wrote: > Since a FIRST block gets called at loop initialization time, it seems to me > that it would be useful to have a block closure trait, RESUME, that gets > called at the beginning of every loop iteration except the first. Thu

Re: Implicit current-index variable, scoped inside for-loops

2006-08-29 Thread Carl Mäsak
Damian (>), Ruud (>>), Damian (>>>), Carl (): > >> But it can hardly be blamed for clarity. > > > > That's a little unfair. > > "can hardly be blamed" -> "can easily be praised" Apologies to Carl if I misinterpreted. I read it as: "can hardly be blamed for (having) clarity" ;-) No,

Re: A suggestion for a new closure trait.

2006-08-29 Thread Jonathan Lang
Joe Gottman wrote: Since a FIRST block gets called at loop initialization time, it seems to me that it would be useful to have a block closure trait, RESUME, that gets called at the beginning of every loop iteration except the first. Thus, at the beginning of each loop iteration either FIRST or R

Questions about statement modifiers

2006-08-29 Thread Agent Zhang
Hi, there~ I think S04 says too little about statement modifiers. Please comment on the following code samples. Are they valid Perl 6? do { say } for 1..3; { say } for 1..3; -> $i { say $i } for 1..3; And how about similar variations for other statement modifiers, such as while, giv

Re: could 'given' blocks have a return value?

2006-08-29 Thread Agent Zhang
On 8/30/06, Mark Stosberg <[EMAIL PROTECTED]> wrote: Sometimes I use 'given' blocks to set a value. To save repeating myself on the right hand side of the given block, I found I kept want to do this: my $foo = given { } According to S04, given {} is at statement level, so you can't use it di

Re: could 'given' blocks have a return value?

2006-08-29 Thread Jonathan Lang
Mark Stosberg wrote: Sometimes I use 'given' blocks to set a value. To save repeating myself on the right hand side of the given block, I found I kept want to do this: my $foo = given { } ...and have whatever value that was returned from when {} or default {} populate $foo. Isn't it still th

Re: Implicit current-index variable, scoped inside for-loops

2006-08-29 Thread Damian Conway
for @array -> $index, $value { say "Element $_ is called $value" } But I don't understand how the "$index, $value" pair gets its values; is @array somehow turned into a hash with the index as the key? With @array -> $index, $value {}, is $_ an alias of $index? No. There's no

Re: Implicit current-index variable, scoped inside for-loops

2006-08-29 Thread Dr.Ruud
"Damian Conway" schreef: > Ruud: >> Damian: >>> Carl: But it can hardly be blamed for clarity. >>> >>> That's a little unfair. >> >> "can hardly be blamed" -> "can easily be praised" > > Apologies to Carl if I misinterpreted. I read it as: > "can hardly be blamed for (having) clarity" >

could 'given' blocks have a return value?

2006-08-29 Thread Mark Stosberg
Sometimes I use 'given' blocks to set a value. To save repeating myself on the right hand side of the given block, I found I kept want to do this: my $foo = given { } ...and have whatever value that was returned from when {} or default {} populate $foo. It turns out pugs already allow this, thr

Why does writing PMCs suck?

2006-08-29 Thread Matt Diephouse
It's been said that writing PMCs sucks. This is your chance to tell the world why. Because for things to get better, we have to know what sucks. I'll get things started: 1) pmc2c.pl is very fragile - when it gets input it doesn't like, it just ignores it (see RT#39313) 2) You can't use :slurpy

Re: Re: PMC Methods, Inheritance, and User-visible Classes

2006-08-29 Thread Matt Diephouse
Joshua Juran <[EMAIL PROTECTED]> wrote: On Aug 28, 2006, at 12:18 PM, Matt Diephouse wrote: > I would like to add some sort methods as well: quicksort(), > mergesort(), etc. But as methods, there is potential for these to end > up in a user-visible space. > > Say for example, that I add a merges

Re: Implicit current-index variable, scoped inside for-loops

2006-08-29 Thread Damian Conway
>> But it can hardly be blamed for clarity. > > That's a little unfair. "can hardly be blamed" -> "can easily be praised" Apologies to Carl if I misinterpreted. I read it as: "can hardly be blamed for (having) clarity" ;-) Damian

[perl #40253] [PATCH] always cast printf("%p") to (void *)

2006-08-29 Thread via RT
# New Ticket Created by Will Coleda # Please include the string: [perl #40253] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=40253 > The attached patch casts all the printfs arguments corresponding to "% p" to be (void *)

Re: Implicit current-index variable, scoped inside for-loops

2006-08-29 Thread Dr.Ruud
Damian Conway schreef: > [attribution repaired] Carl: >> But it can hardly be blamed for clarity. > > That's a little unfair. "can hardly be blamed" -> "can easily be praised" -- Affijn, Ruud "Gewoon is een tijger."

Re: named arguments: What's the signature?

2006-08-29 Thread Mark Stosberg
Trey Harris wrote: > > > Slurpy parameters follow any required or optional parameters. They are > marked by a C<*> before the parameter: > > sub duplicate($n, *%flag, [EMAIL PROTECTED]) {...} > > Named arguments are bound to the slurpy hash (C<*%flag> > in the above example). Such

A suggestion for a new closure trait.

2006-08-29 Thread Joe Gottman
Since a FIRST block gets called at loop initialization time, it seems to me that it would be useful to have a block closure trait, RESUME, that gets called at the beginning of every loop iteration except the first. Thus, at the beginning of each loop iteration either FIRST or RESUME but not both wo

Re: named arguments: What's the signature?

2006-08-29 Thread Stuart Cook
On 8/30/06, Mark Stosberg <[EMAIL PROTECTED]> wrote: Regarding The S06 description of named arguments: http://feather.perl6.nl/syn/S06.html#Named_arguments What I find missing here is documentation of the signature to use if you want to declare "I accept an arbitrary number of named arguments".

Re: named arguments: What's the signature?

2006-08-29 Thread Trey Harris
In a message dated Tue, 29 Aug 2006, Mark Stosberg writes: Regarding The S06 description of named arguments: http://feather.perl6.nl/syn/S06.html#Named_arguments What I find missing here is documentation of the signature to use if you want to declare "I accept an arbitrary number of named argu

named arguments: What's the signature?

2006-08-29 Thread Mark Stosberg
Regarding The S06 description of named arguments: http://feather.perl6.nl/syn/S06.html#Named_arguments What I find missing here is documentation of the signature to use if you want to declare "I accept an arbitrary number of named arguments". (Like the param() methods common in Perl5 do). Maybe

Perilous placeholder parameters

2006-08-29 Thread Stuart Cook
On 8/30/06, Damian Conway <[EMAIL PROTECTED]> wrote: That's a little unfair. Choose good names and it's perfectly clear: map { "Element $^array_index is called $^array_value" } <== @array.kv; As an aside, though, doesn't that particular solution now implicitly rely on the fact that ('inde

return Types: what are the enforcement details?

2006-08-29 Thread Mark Stosberg
I'm interested in helping to write some tests for "return types", but I'd like some clarifications about them first. Are they just "declarations" that help Perl optimize stuff, or they actually contracts? As this little script shows, both "inner" and "of" are valid syntax now with pugs, but neithe

Re: Implicit current-index variable, scoped inside for-loops

2006-08-29 Thread Damian Conway
pugs> map { "Element $^a is called $^b" }: @array.kv; ("Element 0 is called london", "Element 1 is called bridge", "Element 2 is called is", "Element 3 is called falling", "Element 4 is called down") But it can hardly be blamed for clarity. That's a little unfair. Choose good names and it's per

Re: Stubborn coworkers

2006-08-29 Thread A. Pagaltzis
* Jeff Stampes <[EMAIL PROTECTED]> [2006-08-29 17:00]: > Since I came to programming after the days of Forth and Lisp > being prominent languages, I can't dispute nor concur with her > statement. How would you respond? By telling her that the comparison is flawed? Neither Lisp nor Forth have anyt

Fwd: Classes / roles as sets / subsets

2006-08-29 Thread Jonathan Lang
I accidently sent this directly to Richard. Sorry about that, folks... -- Forwarded message -- From: Jonathan Lang <[EMAIL PROTECTED]> Date: Aug 29, 2006 1:24 PM Subject: Re: Classes / roles as sets / subsets To: Richard Hainsworth <[EMAIL PROTECTED]> Richard Hainsworth wrote:

Re: #ParrotSketch Meeting 29AUG06

2006-08-29 Thread Mark J. Reed
Ah, it's scanning the content and finding the control characters. There are a bunch of control-C's in that transcript. Cleaning those up would be helpful, although I consider this bad behavior on Firefox's part - especially since "just display the [EMAIL PROTECTED] thing in the browser" isn't a

Re: #ParrotSketch Meeting 29AUG06

2006-08-29 Thread Mark J. Reed
d Firefox/Mac... and it's not just me... On 8/29/06, Will Coleda <[EMAIL PROTECTED]> wrote: Transcript now available at: http://www.parrotcode.org/misc/parrotsketch-logs/ irclog.parrotsketch-200608/irclog.parrotsketch.20060829 -- Will "Coke" Coleda [EMAIL PROTECTED] -- Mark J. Reed <[EMAIL PROTECTED]>

Re: PMC Methods, Inheritance, and User-visible Classes

2006-08-29 Thread Joshua Juran
On Aug 28, 2006, at 12:18 PM, Matt Diephouse wrote: I would like to add some sort methods as well: quicksort(), mergesort(), etc. But as methods, there is potential for these to end up in a user-visible space. Say for example, that I add a mergesort method to AbstractPMCArray. Ruby's array clas

#ParrotSketch Meeting 29AUG06

2006-08-29 Thread Will Coleda
Transcript now available at: http://www.parrotcode.org/misc/parrotsketch-logs/ irclog.parrotsketch-200608/irclog.parrotsketch.20060829 -- Will "Coke" Coleda [EMAIL PROTECTED]

Re: Stubborn coworkers

2006-08-29 Thread Amir E. Aharoni
Since I came to programming after the days of Forth and Lisp being prominent languages, I can't dispute nor concur with her statement. How would you respond? First, a bit of advice that convinced me to go with Perl 6 not only philosophically, but practically too. Go here: http://www.artlebedev

Re: Implicit current-index variable, scoped inside for-loops

2006-08-29 Thread Jonathan Scott Duff
Having read this thread, I tend to think you're insane for bringing it up again :-) That said, I'll entertain the discussion for a bit ... On Tue, Aug 29, 2006 at 08:33:20AM +0200, Carl Mäsak wrote: > Questions: > > - Is the itch big enough for this? The more I look at the first piece > of cod

Re: Stubborn coworkers

2006-08-29 Thread Jonathan Scott Duff
On Tue, Aug 29, 2006 at 08:57:55AM -0600, Jeff Stampes wrote: > I have one coworker known for her stubbornness. I've been hit with the > following several times, and honestly don't have a good reply: > > "My bigger concern with the Perl6 syntax is that they expect humans to > write it. This is a si

Re: Writing modules

2006-08-29 Thread Gaal Yahas
On Mon, Aug 28, 2006 at 08:30:33AM -0700, Michael Snoyman wrote: > I wanted to start working on a module (mainly to learn Perl 6, I doubt > anyone would ever want to use it). I want to do this "properly," whatever > that means. I was wondering if someone could explain to me: > > 1) How to constr

Re: Stubborn coworkers

2006-08-29 Thread Fagyal Csongor
Jeff, Greetings all. I've followed perl6 development since the beginning, and have tried to stay at least somewhat informed along the way. I'll confess to being puzzled at some of the design decisions, but knowing my own limitations have had faith in @Larry to do the right thing. This topi

Re: Classes / roles as sets / subsets

2006-08-29 Thread Mark J. Reed
On 8/29/06, Daniel Hulme <[EMAIL PROTECTED]> wrote: Perl up to 5 may be executable line noise, but I can see Perl 6 being the closest thing yet to executable maths, and I love it. Funny, I could have sworn APL was the closest thing yet to executable maths. ( Hey, wait a minute, I'm American;

Re: Implicit current-index variable, scoped inside for-loops

2006-08-29 Thread Dr.Ruud
Carl Mäsak schreef: > I suppose doing a map or a grep over @array.kv is possible: > > pugs> my @array = > ("london", "bridge", "is", "falling", "down") > > pugs> map { "Element $^a is called $^b" }: @array.kv; > ("Element 0 is called london", > "Element 1 is called bridge", > "Element 2 is call

Re: Classes / roles as sets / subsets

2006-08-29 Thread Daniel Hulme
> See diagram case 2 (Class A and Class B intersect): > & B are built from a role that represents their intersection ( Class > A U Class B), and then code is added in the definitions of the It may be just me being confused, but the symbol that looks like a U (U+222a) is usually union; intersect

Stubborn coworkers

2006-08-29 Thread Jeff Stampes
Greetings all. I've followed perl6 development since the beginning, and have tried to stay at least somewhat informed along the way. I'll confess to being puzzled at some of the design decisions, but knowing my own limitations have had faith in @Larry to do the right thing. This topic woul

Re: Implicit current-index variable, scoped inside for-loops

2006-08-29 Thread Carl Mäsak
Mark (>), Carl (>>): > Hey do you know what would be cool in perl 6 > A special variable for when you do a for (@array) style loop > it would always have the index of the array > > Discussed on #perl6: it's already quite easy in Perl 6 to loop with an > explicit index: > > my @array = ; > for

Re: Implicit current-index variable, scoped inside for-loops

2006-08-29 Thread Dr.Ruud
"Carl Mäsak" schreef: > Ruud: >> Carl: >>> But maybe a variable that implicitly carries along the loop index >>> would be even snazzier? >>> >>> for @array -> $val { >>> say "$.\t$val"; >>> } >> >> Or give the block a name (label), and have an index (or several >> indexes, like some that are res

Classes / roles as sets / subsets

2006-08-29 Thread Richard Hainsworth
Originally this posting was written in response to the 'ref' spec thread. I included char diagrams that got screwed up, so I made a png diagram instead (attached) and I re-edited the posting to refer to attached diagram, and then added some more comments. Hope everyone can 'see' the png. I fi

Re: Implicit current-index variable, scoped inside for-loops

2006-08-29 Thread Mark A. Biggar
Carl Mäsak wrote: Hey do you know what would be cool in perl 6 A special variable for when you do a for (@array) style loop it would always have the index of the array Discussed on #perl6: it's already quite easy in Perl 6 to loop with an explicit index: my @array = ; for @array.kv -> $i, $v

Re: Implicit current-index variable, scoped inside for-loops

2006-08-29 Thread Carl Mäsak
Ruud (>), Carl (>>): > But maybe a variable that implicitly carries along the loop index > would be even snazzier? > > for @array -> $val { > say "$.\t$val"; > } Or give the block a name (label), and have an index (or several indexes, like some that are reset by redo an some that are not) avai

Re: Implicit current-index variable, scoped inside for-loops

2006-08-29 Thread Ruud H.G. van Tol
Carl Mäsak wrote: > But maybe a variable that implicitly carries along the loop index > would be even snazzier? > > for @array -> $val { > say "$.\t$val"; > } Or give the block a name (label), and have an index (or several indexes, like some that are reset by redo an some that are not) availabl