Re: (1,(2,3),4)[2]

2005-05-26 Thread Markus Laire
Rod Adams wrote: TSa (Thomas Sandlaß) wrote: You mean @a = [[1,2,3]]? Which is quite what you need for multi dimensional arrays anyway @m = [[1,2],[3,4]] and here you use of course @m[0][1] to pull out the 2. I'm not sure if this automatically makes the array multi-dimensional to the type

Re: (1,(2,3),4)[2]

2005-05-26 Thread Markus Laire
Rod Adams wrote: Austin Hastings wrote: --- Rod Adams [EMAIL PROTECTED] wrote: TSa (Thomas Sandlaß) wrote: @m = [[1,2],[3,4]] @m[0;1] is a multidim deref, referencing the 4. Referencing the 2, I hope? Doh! Yes, the 2. Really? @m here has _single_ array-ref so @m[0] returns that

Re: (1,(2,3),4)[2]

2005-05-26 Thread Rod Adams
Markus Laire wrote: Rod Adams wrote: TSa (Thomas Sandlaß) wrote: You mean @a = [[1,2,3]]? Which is quite what you need for multi dimensional arrays anyway @m = [[1,2],[3,4]] and here you use of course @m[0][1] to pull out the 2. I'm not sure if this automatically makes the array

Re: (1,(2,3),4)[2]

2005-05-26 Thread Juerd
Rod Adams skribis 2005-05-26 4:15 (-0500): From S02: Array and hash variable names in scalar context automatically produce references. Since [...] produces a scalar arrayref, we end up with an arrayref one both sides of the =. No. There is no scalar context on the LHS of the assignment

Re: (1,(2,3),4)[2]

2005-05-26 Thread Rob Kinyon
Is giving = a higher precedence than , still considered A Good Thing? I'm not familiar with the reasoning behind the current situation, but I'm struggling to come up with any good reasons for keeping it. Consider the alternative: my $a, $b = 1, 2; # $b should contain 2, not 1 I read

Re: Syntax of using Perl5 modules?

2005-05-26 Thread Adam Kennedy
On the migration front, when someone ports Digest.pm to Perl6, I get a free upgrade, assuming the module author was kind enough to up the version number. You are making a pretty huge assumption here that whoever has a namespace in p5 CPAN has first dibs at the P6 namespace of the same name,

Re: Virtual methods

2005-05-26 Thread Aaron Sherman
On Wed, 2005-05-25 at 09:11, Piers Cawley wrote: Aaron Sherman [EMAIL PROTECTED] writes: There are many gotchas that fall out of that. For example, you might have a special role that overrides .print to handle structured data, so your code says: my Foo $obj; given $obj {

Re: comprehensive list of perl6 rule tokens

2005-05-26 Thread Patrick R. Michaud
On Tue, May 24, 2005 at 08:25:03PM -0400, Jeff 'japhy' Pinyan wrote: I have looked through the latest revisions of Apo05 and Syn05 (from Dec 2004) and come up with the following list: http://japhy.perlmonk.org/perl6/rules.txt I'll review the list below, but it's also worthwhile to read

Re: comprehensive list of perl6 rule tokens

2005-05-26 Thread Patrick R. Michaud
Rather than answer each message in this thread individually, I'll try to aggregate them here. Disclaimer: These are just my interpretations of how rules are defined; I'm not the one who decides how they *should* be defined. On Wed, May 25, 2005 at 10:55:59AM -0400, Jeff 'japhy' Pinyan wrote:

Re: Perl development server

2005-05-26 Thread Marco Romano
Hi All! If you want access, please let me know. I will send you a temporary password by e-mail, that I expect you to change the first time you get the chance. May i have an account name nemux ? Thanks! Marco.

Re: Reductions, junctions, hashslices, and cribbage scoring

2005-05-26 Thread John Williams
On Wed, 25 May 2005, Rob Kinyon wrote: (This post references the discussion at http://www.perlmonks.org/?node_id=458728, particularly dragonchild's response at the bottom.) For those who don't know, cribbage is a game where each player has access to 4 cards, plus a community card. Various

Re: Perl6 and support for Refactoring IDE's

2005-05-26 Thread Piers Cawley
Stevan Little [EMAIL PROTECTED] writes: On May 25, 2005, at 5:39 AM, Piers Cawley wrote: One of the 'mental apps' that's been pushing some of the things I've been asking for in Perl 6's introspection system is a combined refactoring/debugging/editing environment for the language. Maybe I

Re: comprehensive list of perl6 rule tokens

2005-05-26 Thread Patrick R. Michaud
On Wed, May 25, 2005 at 08:28:11AM -0700, Mark A. Biggar wrote: Jeff 'japhy' Pinyan wrote: Yeah, that was going to be my next step, except that the unknowing person might make a sub-rule of their own called, say, Zs, and then which would take precedence? Perhaps prop:X is a good way of

Re: Reductions, junctions, hashslices, and cribbage scoring

2005-05-26 Thread Rob Kinyon
Assuming you write the subset coroutine above, how about $score += ( subsets(0..4) == map { 2 * (15 == [+] @[EMAIL PROTECTED]) } == [+] ) Working on it last night and this morning, I ended up with the following, very similar rewrite. sub gen_idx_powerset (Int $size is copy) returns

Sets (was: Reductions, junctions, hashslices, and cribbage scoring)

2005-05-26 Thread Patrick R. Michaud
On Thu, May 26, 2005 at 11:03:15AM -0600, John Williams wrote: I proposed the following: # Fifteens $score += 2 * all( 15 == [EMAIL PROTECTED] any( 0 .. 4 ) } ); * Is this syntax legal? I think so. * Does it do what I want it to do? Definitely not. First, apologies in

Re: Syntax of using Perl5 modules?

2005-05-26 Thread Rod Adams
Adam Kennedy wrote: On the migration front, when someone ports Digest.pm to Perl6, I get a free upgrade, assuming the module author was kind enough to up the version number. You are making a pretty huge assumption here that whoever has a namespace in p5 CPAN has first dibs at the P6

Re: (1,(2,3),4)[2]

2005-05-26 Thread Rod Adams
Juerd wrote: Rod Adams skribis 2005-05-26 4:15 (-0500): From S02: Array and hash variable names in scalar context automatically produce references. Since [...] produces a scalar arrayref, we end up with an arrayref one both sides of the =. No. There is no scalar context on the LHS

$*OS and OS::* mixins

2005-05-26 Thread Rob Kinyon
I was thinking on the drive home how to write some of the File::Spec functions in P6. I realized that it would be really neat if $*OS did one of a bunch of mixins (maybe OS::unix, OS::win32, OS::vms, etc). That way, you could multimethod the various functions, using junctions and Any to provide a

Re: comprehensive list of perl6 rule tokens

2005-05-26 Thread Jeff 'japhy' Pinyan
On May 26, Patrick R. Michaud said: On Tue, May 24, 2005 at 08:25:03PM -0400, Jeff 'japhy' Pinyan wrote: I have looked through the latest revisions of Apo05 and Syn05 (from Dec 2004) and come up with the following list: http://japhy.perlmonk.org/perl6/rules.txt I'll review the list below,

Re: comprehensive list of perl6 rule tokens

2005-05-26 Thread Patrick R. Michaud
On Thu, May 26, 2005 at 07:05:41PM -0400, Jeff 'japhy' Pinyan wrote: Here the leading tokens are actually $, ::$, @, %, {, , and (, and I suspect we have ?$, ?::$, ?@, and !$, !::$, !@, etc. counterparts. Per your second message, [EMAIL PROTECTED] would mean !before @rules, right? I think

Re: Sets

2005-05-26 Thread Sam Vilain
Patrick R. Michaud wrote: The continuing exchanges regarding junctions, and the ongoing tendency by newcomers to think of them and try to use them as sets, makes me feel that it might be worthwhile to define and publish a standard CSet class and operations sooner rather than later in Perl 6