Re: What Requires Core Support (app packaging)
Nicholas Clark wrote: On Tue, Sep 07, 2004 at 06:07:24PM +0200, James Mastros wrote: 4. The single-file, platform dependent, machine language executable (realexe). Which parrot can already do. (Or at least could, but I don't think that anyone's been checking on it recently) Er, right -- I'd meant to say that there, but I must have lost it when I decided my verbiage was horrible and rewrote it. (There's a reason I don't post often.) Mostly, though, they require fairly minimal support from the core. Only 1 requires Cperl support, and that support is very minimal. The and as you say all this really isn't about perl 6 the language. Exactly -- most of this sort of thing is about perl's standard library, which I think is a discussion for much, much later, and a discussion (one that, for the most part, is finished) for perl6-language (the part of the list that should be renamed to parrot). -=- James Mastros
Re: Synopsis 9 draft 1
On Thu, 2 Sep 2004, Larry Wall wrote: To declare a multidimensional array, you add a shape parameter: my num @nums is shape(3); # one dimension, @nums[0..2] my int @ints is shape(4;2); # two dimensions, @ints[0..3; 0..1] Just a random thought, and probably a minor point: I know that there already so many keywords, but if not already taken, could Chas be introduced as a synonim for Cis to be freely used where it would fit better? Especially in constructs like my num @data is Stuff has shape(4;2); Michele -- I was wondering if there is someone who knows a good perl spam filter. That's funny. Most of my spam is for v1agr4 and p3nis [EMAIL PROTECTED], not Perl. - John J. Trammell in clpmisc, Re: Perl Spam Filter (slightly edited)
Re: Synopsis 9 draft 1
Michele Dondi wrote: On Thu, 2 Sep 2004, Larry Wall wrote: To declare a multidimensional array, you add a shape parameter: my num @nums is shape(3); # one dimension, @nums[0..2] my int @ints is shape(4;2); # two dimensions, @ints[0..3; 0..1] Just a random thought, and probably a minor point: I know that there already so many keywords, but if not already taken, could Chas be introduced as a synonim for Cis to be freely used where it would fit better? Especially in constructs like my num @data is Stuff has shape(4;2); Chas is already used to give classes attributes... class Thing { has @.fingers; has $.mysteriousness; } I wouldn't be surprised if it does run-time attribute addition to objects as well, but I can't recall seeing that anywhere and haven't got time to look right now. Even if it doesn't, it would, I think, be a mistake to overload it in this way.
Q: re C -
I hope not to raise too much the noise/signal level on list, but I have a question: I have had a long experience programming my HP28s pocket calculator, and its RPN language that AFAIK is mostly the same as that of newer models, supported constructs of the form - a b ... where C - is a literal right arrow char and C and C are literal guillemets (delimiting blocks). Just wonder wether by any chance *that* language has had any influence on the - $x, $y { ... } construct. Michele -- Di solito vedo persone come te svenute nelle taverne. Ancor PRIMA che ti sentano l'alito? Non accettero' la tua impertinenza restando seduto! - don't t0uch su it.discussioni.litigi
Re: Synopsis 9 draft 1
On Thu, Sep 09, 2004 at 03:09:47PM +0200, Michele Dondi wrote: On Thu, 2 Sep 2004, Larry Wall wrote: And yes, an Cint1 can store only -1 or 0. I'm sure someone'll think of a use for it... Probably OT, but I've needed something like that badly today: working on a japh that turned out to require mostly golfing skills (and not that I have many, I must admit)... well, it would have been useful to have, say, a pack template for 2-bits unsigned integers... As an array index -1 and 0 give you the 2 ends. The perl5 code to alternately extract elements from the two eds of an array can be something like: my $end = 0;# -1 to start with right end while( @array ) { my $next = splice( @array, $end, 1 ); # use the $next element $end = -1 - $end; } Using int1 for $end, that last line can be changed in a variety of ways, such as: $end ^= 1; (except that the p5 ^= operator is written differently in p6) This is not a *good* use of int1 though. :-) --
Re: Q: re C -
On Thu, Sep 09, 2004 at 03:20:22PM +0200, Michele Dondi wrote: : I hope not to raise too much the noise/signal level on list, but I have a : question: I have had a long experience programming my HP28s pocket : calculator, and its RPN language that AFAIK is mostly the same as that of : newer models, supported constructs of the form : : - a b ... : : where C - is a literal right arrow char and C and C : are literal guillemets (delimiting blocks). Just wonder wether by any : chance *that* language has had any influence on the : : - $x, $y { ... } : : construct. Nope. I used to think RPN was completely unnatural. Then I started learning Japanese, and now I not so sure am. :-) I just borrowed the - from Perl 5 because I knew it was available, and I thought it read better for Cfor loops than the Ruby approach. Larry
Re: Synopsis 9 draft 1
John Macdonald writes: As an array index -1 and 0 give you the 2 ends. The perl5 code to alternately extract elements from the two eds of an array can be something like: my $end = 0; # -1 to start with right end while( @array ) { my $next = splice( @array, $end, 1 ); # use the $next element $end = -1 - $end; } Using int1 for $end, that last line can be changed in a variety of ways, such as: $end ^= 1; Well, if you're golfing: $end++; If the low level types wrap around rather than promote; Luke
Iterators and Cfor
On Sep 9, 2004, at 9:14 AM, Larry Wall wrote: I just borrowed the - from Perl 5 because I knew it was available, and I thought it read better for Cfor loops than the Ruby approach. Interestingly, I was at PDX.pm last night for a presentation entitled, Ruby for Perl Programmers. One of the things that the presenters said was typical idiomatic Ruby was the use of blocks (I think that's what they called them) with iterators, such that you almost *never* see the use of Cfor in Ruby. Might a similar thing happen with Perl 6 code blocks and iterators? Regards, David
Re: Iterators and Cfor
On Thu, Sep 09, 2004 at 09:27:36AM -0700, David Wheeler wrote: : On Sep 9, 2004, at 9:14 AM, Larry Wall wrote: : : I just borrowed the - from Perl 5 because I knew it was available, : and I thought it read better for Cfor loops than the Ruby approach. : : Interestingly, I was at PDX.pm last night for a presentation entitled, : Ruby for Perl Programmers. One of the things that the presenters said : was typical idiomatic Ruby was the use of blocks (I think that's what : they called them) with iterators, such that you almost *never* see the : use of Cfor in Ruby. : : Might a similar thing happen with Perl 6 code blocks and iterators? That is basically what the thread Revision of A12's lookahead notions was all about, though perhaps it didn't look like it on the surface. The upshot of which was that if you want to take the Ruby approach in Perl 6, it takes an extra colon to keep the parser happy: @foo.each:{ ... } Ruby gets away without the colon because it require parens around all its arguments except for the magic block, which is required to go outside the parens, if any. That's conducive to the Ruby style at the expense of other styles. But Perl is supposed to be multi-paradigmatic, so I'd rather support many styles, including the ability to pass closures in any argument position, not just the magic position. And in particular, I'd also like to be able to drop the parens on things like: if $a eq $b { ... } while $c { ... } for 1,2,3 { ... } So whereas Ruby's syntax actually tends to push you toward .each iterators, Perl 6's syntax will be fairly neutral on the subject, or maybe biased every so slightly away from method iteration by the width of about one character: for @foo { ... } @foo.each:{ ... } But then, a good Ruby programmer would have put a space where there's a colon anyway, so maybe it's a wash. If I wanted to make it even I'd pick something shorter than each, I suppose. Except all is already taken. I suppose there's something to be said for: @foo.for:{ ... } But then you have to think in Japanese, and you'll note that even Matz is too polite to force us gaijin into using postpositions rather than prepositions. On the other hand, maybe I can muster the hubris to speak for all gaijin and say that's okay in this case. :-) Larry
Re: Synopsis 9 draft 1
Michele Dondi writes: On Thu, 2 Sep 2004, Larry Wall wrote: To declare a multidimensional array, you add a shape parameter: my num @nums is shape(3); # one dimension, @nums[0..2] my int @ints is shape(4;2); # two dimensions, @ints[0..3; 0..1] Just a random thought, and probably a minor point: I know that there already so many keywords, but if not already taken, could Chas be introduced as a synonim for Cis to be freely used where it would fit better? Especially in constructs like my num @data is Stuff has shape(4;2); I also think Cis shape reads awkwardly. Would making it Cis shaped be any better? my num @data is Stuff is shaped(4;2); Smylers
Re: Iterators and Cfor
On Thu, 2004-09-09 at 13:14, Larry Wall wrote: So whereas Ruby's syntax actually tends to push you toward .each iterators, Perl 6's syntax will be fairly neutral on the subject, or maybe biased every so slightly away from method iteration by the width of about one character: for @foo { ... } @foo.each:{ ... } But then, a good Ruby programmer would have put a space where there's a colon anyway, so maybe it's a wash. If I wanted to make it even I'd pick something shorter than each, I suppose. Except all is already taken. I suppose there's something to be said for: @foo.for:{ ... } act any are ask cog cue did ere for get got has hop jet job kin let map mix net now one ore per pro put run set tag I won't describe why I think each one would be appropriate, since if it's not obvious, it's a bad choice ;-) -- 781-324-3772 [EMAIL PROTECTED] http://www.ajs.com/~ajs
Re: Iterators and Cfor
Aaron Sherman [EMAIL PROTECTED] writes: On Thu, 2004-09-09 at 13:14, Larry Wall wrote: So whereas Ruby's syntax actually tends to push you toward .each iterators, Perl 6's syntax will be fairly neutral on the subject, or maybe biased every so slightly away from method iteration by the width of about one character: for @foo { ... } @foo.each:{ ... } But then, a good Ruby programmer would have put a space where there's a colon anyway, so maybe it's a wash. If I wanted to make it even I'd pick something shorter than each, I suppose. Except all is already taken. I suppose there's something to be said for: @foo.for:{ ... } act any are ask cog cue did ere for get got has hop jet job kin let map mix net now one ore per pro put run set tag I won't describe why I think each one would be appropriate, since if it's not obvious, it's a bad choice ;-) I find myself wondering if this is going to allow people to write smalltalk style method selectors... @foo.inject:0 into: - $accum, $each { $accum + $each }