S28ish [was: [Pugs] A couple of string interpolation edge cases]

2005-03-26 Thread Larry Wall
On Sat, Mar 26, 2005 at 02:11:29PM +0800, Autrijus Tang wrote: : On Fri, Mar 25, 2005 at 10:03:45PM -0800, Larry Wall wrote: : Hmm, well, if it got that far. Given strict being on by default, : this particular example should probably just die on the fact that $ : isn't declared, since there's

Parameter and trait questions - just how 'only' _is_ 'read-only'?

2005-03-26 Thread Chip Salzenberg
I'm working on enhancing Perl6::Subs[*] to support more parameter traits than just Cis required. I have some questions about parameters and traits. (These questions all apply to pure Perl 6, which I know I won't be able to translate completely, but I want to know which target I'm missing.) *

Re: String Theory

2005-03-26 Thread Chip Salzenberg
Would this be a good time to ask for explanation for Cstr being never Unicode, while CStr is always Unicode, thus leading to an inability to box a non-Unicode string? And might I also ask why in Perl 6 (if not Parrot) there seems to be no type support for strings with known encodings which are

Re: PPI and the Perl 5 to Perl 6 converter?

2005-03-26 Thread Adam Kennedy
Er, I'm not sure you will want to--I'm using PPI's evil twin brother, PPD (the actual Perl parser). I've just modified it so it doesn't forget anything I want it to remember. (As you know, the standard parser throws away gobs of useful information, everything from whitespace and comments to

Re: Parameter and trait questions - just how 'only' _is_ 'read-only'?

2005-03-26 Thread Luke Palmer
Chip Salzenberg writes: I'm working on enhancing Perl6::Subs[*] to support more parameter traits than just Cis required. I have some questions about parameters and traits. (These questions all apply to pure Perl 6, which I know I won't be able to translate completely, but I want to know

[Fwd: Re: Moving the p5 standard library to p6]

2005-03-26 Thread chromatic
Forwarded... On Sat, 2005-03-26 at 12:05 +1100, Andrew Savige wrote: Please note that I am not an expert on any of this, I was just wondering whether we are going to clean up the old p5 library interfaces as part of the move to p6. Or must we support the old p5 library interfaces for

Re: [Fwd: Re: Moving the p5 standard library to p6]

2005-03-26 Thread Juerd
chromatic skribis 2005-03-26 2:13 (-0800): No. Please, no. :) As I see it, Perl 6 has a chance to start over with a very small set of core libraries -- perhaps embarrassingly small -- so as not to entomb our current, potentially-blepharitic guesses at good Perl 6 design principles for the

Re: S28ish [was: [Pugs] A couple of string interpolation edge cases]

2005-03-26 Thread Luke Palmer
Larry Wall creates Sish28: On Sat, Mar 26, 2005 at 02:11:29PM +0800, Autrijus Tang wrote: : On Fri, Mar 25, 2005 at 10:03:45PM -0800, Larry Wall wrote: : Hmm, well, if it got that far. Given strict being on by default, : this particular example should probably just die on the fact that $ :

Re: S28ish [was: [Pugs] A couple of string interpolation edge cases]

2005-03-26 Thread Aaron Sherman
On Sat, 2005-03-26 at 00:27 -0800, Larry Wall wrote: $$ is now $*PID. ($$foo is now unambuous.) $0 is gone in favor of $*PROGRAM_NAME or some such. You know, Java did one thing in this respect that I liked, and managed to do it in a way that I couldn't stand. The idea of program as object

Re: PPI and the Perl 5 to Perl 6 converter?

2005-03-26 Thread Larry Wall
On Sat, Mar 26, 2005 at 06:49:58PM +1100, Adam Kennedy wrote: : Er, I'm not sure you will want to--I'm using PPI's evil twin brother, : PPD (the actual Perl parser). I've just modified it so it doesn't : forget anything I want it to remember. (As you know, the standard : parser throws away gobs

Re: Parameter and trait questions - just how 'only' _is_ 'read-only'?

2005-03-26 Thread Rod Adams
Chip Salzenberg wrote: * As far as I can tell, the choice of spelling an array parameter CArray @a or CArray $a is entirely cosmetic: both @a and $a are capable of holding an Array reference. Is there actually a difference, e.g. in how they handle an undefined value? Uhm... It was my

Re: String Theory

2005-03-26 Thread Rod Adams
Chip Salzenberg wrote: Would this be a good time to ask for explanation for Cstr being never Unicode, while CStr is always Unicode, thus leading to an inability to box a non-Unicode string? That's not quite it. Cstr is a forced Unicode level of Bytes, with encoding raw, which happens to not

Re: S28ish [was: [Pugs] A couple of string interpolation edge cases]

2005-03-26 Thread Larry Wall
On Sat, Mar 26, 2005 at 03:37:41AM -0700, Luke Palmer wrote: : $! will be a legal variable name. $/ is going away, : : By which you mean that $/ is turning into a special $0. I'd say that $0 is a specialization of $/, but yes, basically, they both represent the current match result, albeit

Re: S28ish [was: [Pugs] A couple of string interpolation edge cases]

2005-03-26 Thread Rod Adams
Larry Wall wrote: %+ and %- are gone. $0, $1, $2, etc. are all objects that know where they .start and .end. (Mind you, those methods return magical positions that are Unicode level independent.) How can you have a level independent position? The matching itself happens at a specified level.

Re: S28ish [was: [Pugs] A couple of string interpolation edge cases]

2005-03-26 Thread Larry Wall
On Sat, Mar 26, 2005 at 09:59:10AM -0500, Aaron Sherman wrote: : On Sat, 2005-03-26 at 00:27 -0800, Larry Wall wrote: : : $$ is now $*PID. ($$foo is now unambuous.) : : $0 is gone in favor of $*PROGRAM_NAME or some such. : : You know, Java did one thing in this respect that I liked, and

Re: S28ish [was: [Pugs] A couple of string interpolation edge cases]

2005-03-26 Thread Aaron Sherman
On Sat, 2005-03-26 at 12:48 -0800, Larry Wall wrote: On Sat, Mar 26, 2005 at 09:59:10AM -0500, Aaron Sherman wrote: Well, there is a process object, but it actually exists inside the operating system. It's a little silly to force people to name their own process all the time. I think we can

Perl5-P6 convertor as refactoring tool

2005-03-26 Thread David Storrs
On Sat, Mar 26, 2005 at 10:13:54AM -0800, Larry Wall wrote: The thing is that these MAD props are hung on whatever node is handy at the time, [...]. That's the main reason for the first pass of translator, to reattach the madprops at a more appropriate place in the tree. [...] But with

Re: Parameter and trait questions - just how 'only' _is_ 'read-only'?

2005-03-26 Thread Chip Salzenberg
According to Rod Adams: Chip Salzenberg wrote: * As far as I can tell, the choice of spelling an array parameter CArray @a or CArray $a is entirely cosmetic: both @a and $a are capable of holding an Array reference. Is there actually a difference, e.g. in how they handle an undefined

Re: [Fwd: Re: Moving the p5 standard library to p6]

2005-03-26 Thread Larry Wall
On Sat, Mar 26, 2005 at 11:31:07AM +0100, Juerd wrote: : Perhaps good administration would be to introduce a generic Deprecated:: : namespace. Module authors can move their own old modules there if they : want, and there can be Deprecated::P5 for stuff like dbmopen, :

Re: Parameter and trait questions - just how 'only' _is_ 'read-only'?

2005-03-26 Thread Larry Wall
On Sat, Mar 26, 2005 at 03:45:30PM -0500, Chip Salzenberg wrote: : According to Rod Adams: : Chip Salzenberg wrote: : * As far as I can tell, the choice of spelling an array parameter :CArray @a or CArray $a is entirely cosmetic: both @a and :$a are capable of holding an Array reference.

Re: Parameter and trait questions - just how 'only' _is_ 'read-only'?

2005-03-26 Thread Larry Wall
On Sat, Mar 26, 2005 at 03:13:07AM -0700, Luke Palmer wrote: : Chip Salzenberg writes: : I'm working on enhancing Perl6::Subs[*] to support more parameter : traits than just Cis required. I have some questions about : parameters and traits. (These questions all apply to pure Perl 6, : which

Re: S28ish [was: [Pugs] A couple of string interpolation edge cases]

2005-03-26 Thread Larry Wall
On Sat, Mar 26, 2005 at 02:37:24PM -0600, Rod Adams wrote: : Larry Wall wrote: : : %+ and %- are gone. $0, $1, $2, etc. are all objects that know : where they .start and .end. (Mind you, those methods return magical : positions that are Unicode level independent.) : : How can you have a level

Re: String Theory

2005-03-26 Thread Larry Wall
On Fri, Mar 25, 2005 at 07:38:10PM -, Chip Salzenberg wrote: : Would this be a good time to ask for explanation for Cstr being : never Unicode, while CStr is always Unicode, thus leading to an : inability to box a non-Unicode string? As Rod said, str is just a way of declaring a byte buffer,

Re: How could import constants from other modules?

2005-03-26 Thread Larry Wall
On Fri, Mar 18, 2005 at 03:38:38PM +0800, song10 wrote: : hi, all : : is there any way to import constants from other modules without : specifying scope everytime? : such like this: : : module A; : use constant { PI = 3.14, VER = 1.1 } : ... : : : : module B; : my $var = A::PI; # this way

Re: Parameter and trait questions - just how 'only' _is_ 'read-only'?

2005-03-26 Thread Uri Guttman
LW == Larry Wall [EMAIL PROTECTED] writes: LW That being said, in Perl 5, if you say LW @a = undef; LW you don't get an undefined array. I'd like to make undef smart enough LW about list contexts that @a actually does end up undefined in Perl 6. LW That is, in scalar context,

Re: Parameter and trait questions - just how 'only' _is_ 'read-only'?

2005-03-26 Thread Uri Guttman
LW == Larry Wall [EMAIL PROTECTED] writes: LW As I mentioned in my other message, I think we should not assume that LW Perl 6 works the same in this regard as Perl 5 does. There needs to be LW something we can return that not only means (), but means also means LW You're hosed! (And

Re: return of copies vs references

2005-03-26 Thread Larry Wall
On Thu, Mar 17, 2005 at 07:21:18PM +0100, Thomas Sandlaß wrote: : Larry Wall wrote: : That's actually weirdly symmetrical with the notion that only subs can : impose compile-time context on their arguments, while methods always : have to assume list context because you have to generate the

Re: Parameter and trait questions - just how 'only' _is_ 'read-only'?

2005-03-26 Thread Larry Wall
On Sun, Mar 27, 2005 at 12:04:39AM -0500, Uri Guttman wrote: : LW == Larry Wall [EMAIL PROTECTED] writes: : : LW As I mentioned in my other message, I think we should not assume that : LW Perl 6 works the same in this regard as Perl 5 does. There needs to be : LW something we can return

Re: Parameter and trait questions - just how 'only' _is_ 'read-only'?

2005-03-26 Thread Larry Wall
On Sat, Mar 26, 2005 at 11:57:48PM -0500, Uri Guttman wrote: : LW == Larry Wall [EMAIL PROTECTED] writes: : : LW That being said, in Perl 5, if you say : : LW @a = undef; : : LW you don't get an undefined array. I'd like to make undef smart enough : LW about list contexts that @a

Re: Parameter and trait questions - just how 'only' _is_ 'read-only'?

2005-03-26 Thread Uri Guttman
LW == Larry Wall [EMAIL PROTECTED] writes: LW : then how would you assign undef to the only element of the LW array? would this : be needed: LW : LW : @a = ( undef ) ;# same as p5? LW : LW : vs. LW : @a = undef ;# like undef @a in p5? LW