Re: study

2005-03-20 Thread Luke Palmer
Rod Adams writes: > Luke Palmer wrote: > >Ummm... yeah, keep a function around if it's not currently implemented. > >I don't think so. > > > I see that as preferable to saying "we had it in 5.10, we dropped it in > 6.0, then added it back in for 6.2." Umm... your statement isn't quite so shock

Re: Slices

2005-03-20 Thread Brent 'Dax' Royal-Gordon
Luke Palmer <[EMAIL PROTECTED]> wrote: > > Can I use slice notation when dealing with strings? > > > >say $string[-1]; # say substr($string, -1); > >$string[0..2] = "Hello"; > > No. I'm pretty sure that's the Right Thing, too. First, the "sixth > element" in a string depends on how you'r

Re: study

2005-03-20 Thread Rod Adams
Luke Palmer wrote: Rod Adams writes: C is an odd sort of function. AFAIK, it's the only optimization hint that we have. Will the P6RE even use this information, and is it worth keeping? My gut feeling tells me that it will be useful again around 6.2, and we should keep it around until then as

Re: Slices

2005-03-20 Thread Rod Adams
Matt Diephouse wrote: Is it possible to assign to an array slice? @array[0..4] = ( 0..4 ); # splice @array, 0, 5, 0..4 If so (and I'm hoping it is), is there an equivalent of Ruby's `[]=` method? (Is there a way to define this behavior within my own array-like classes?) I assign to array and ha

Re: Slices

2005-03-20 Thread Luke Palmer
Matt Diephouse writes: > Is it possible to assign to an array slice? > > @array[0..4] = ( 0..4 ); # splice @array, 0, 5, 0..4 Of course. You could in Perl 5, right? > If so (and I'm hoping it is), is there an equivalent of Ruby's `[]=` > method? (Is there a way to define this behavior within

Re: study

2005-03-20 Thread Luke Palmer
Rod Adams writes: > C is an odd sort of function. AFAIK, it's the only optimization > hint that we have. > > Will the P6RE even use this information, and is it worth keeping? > > My gut feeling tells me that it will be useful again around 6.2, and we > should keep it around until then as a pote

Slices

2005-03-20 Thread Matt Diephouse
Is it possible to assign to an array slice? @array[0..4] = ( 0..4 ); # splice @array, 0, 5, 0..4 If so (and I'm hoping it is), is there an equivalent of Ruby's `[]=` method? (Is there a way to define this behavior within my own array-like classes?) Can I use slice notation when dealing with st

study

2005-03-20 Thread Rod Adams
C is an odd sort of function. AFAIK, it's the only optimization hint that we have. Will the P6RE even use this information, and is it worth keeping? My gut feeling tells me that it will be useful again around 6.2, and we should keep it around until then as a potential no-op. Comments? -- Rod Ad

chr and ord

2005-03-20 Thread Rod Adams
I'm thinking C and C should be strictly Code Point level activities, but I'm not sure. They likely need to be renamed, in any event, to better reflect the fact that everything is Unicode these days. -- Rod Adams

Re: eval (was Re: New S29 draft up)

2005-03-20 Thread Rod Adams
Larry Wall wrote: On Fri, Mar 18, 2005 at 10:28:18AM -0500, Aaron Sherman wrote: : Thus: : : eval read :file("foo"); : : There you have it. The problem being that it will now report errors in some random temporary string rather than at some line number in a file. Not good. Orthogonality strike

nothing

2005-03-20 Thread Rod Adams
Does Perl need a no-op function? With the addition of "no bare literals", it makes constructs like 1 while some_func(); an error. I propose creating a no-op function "nothing" that can be used here or anywhere else you specifically wish to do nothing at all. given $this { when Even { nothing

Re: New S29 draft up

2005-03-20 Thread Rod Adams
Luke Palmer wrote: Matt Diephouse writes: Juerd <[EMAIL PROTECTED]> wrote: Matt Diephouse skribis 2005-03-18 13:35 (-0500): Too bad sub names can't start with numbers: 0x $hex; # hex $hex But they can, if you call them prefix operators instead of subs. See also -e and alike

Re: New S29 draft up

2005-03-20 Thread Luke Palmer
Matt Diephouse writes: > Juerd <[EMAIL PROTECTED]> wrote: > > Matt Diephouse skribis 2005-03-18 13:35 (-0500): > > > Too bad sub names can't start with numbers: > > > 0x $hex; # hex $hex > > > > But they can, if you call them prefix operators instead of subs. See > > also -e and alike operators,

Re: Perl6 and Duff's Device

2005-03-20 Thread Luke Palmer
Gaal Yahas writes: > It looks like Duff's Device > won't be possible in Perl6. This is a shame. > > sub duff ($from) { > # real life would use reference here, this is a demo > # dummy: simulate write to serial i/o port >

Re: Referencing a caller's slurpy array.

2005-03-20 Thread Rod Adams
Larry Wall wrote: On Wed, Mar 16, 2005 at 11:49:12PM -0600, Rod Adams wrote: : I haven't gotten a solid answer on when and how Perl will autogenerate : methods from subs. In general I don't think of it as autogeneration at all, but as failover to a different dispatcher. I can't think of a case

Re: New S29 draft up

2005-03-20 Thread Matt Diephouse
Juerd <[EMAIL PROTECTED]> wrote: > Matt Diephouse skribis 2005-03-18 13:35 (-0500): > > Too bad sub names can't start with numbers: > > 0x $hex; # hex $hex > > But they can, if you call them prefix operators instead of subs. See > also -e and alike operators, which start with a character that is

Re: New S29 draft up

2005-03-20 Thread Juerd
Matt Diephouse skribis 2005-03-18 13:35 (-0500): > > +"0x$_" # hex > > +"0o$_" # oct > > +"0b$_" # bin (does not exist in Perl 5) > Too bad sub names can't start with numbers: > 0x $hex; # hex $hex But they can, if you call them prefix operators instead of subs. See also -e and alike operator

Perl6 and Duff's Device

2005-03-20 Thread Gaal Yahas
It looks like Duff's Device won't be possible in Perl6. This is a shame. sub duff ($from) { # real life would use reference here, this is a demo # dummy: simulate write to serial i/o port my $to; my $i = 0;