Re: Context of hash slices; quotation adverbs

2005-04-17 Thread Larry Wall
On Sun, Apr 17, 2005 at 07:54:18PM +0300, Roie Marianer wrote: : Hi all, : I'm back with more quoting construct madness. Kewl, d00d. : First, context of hash slices: : Hash slices with {} notation are trivially either scalars or lists: : $h{'foo'} = want(); # Scalar : $h{'foo','bar'} = want();

Re: Context of hash slices; quotation adverbs

2005-04-17 Thread Larry Wall
On Sun, Apr 17, 2005 at 08:00:00PM -0700, Brent 'Dax' Royal-Gordon wrote: : Larry Wall [EMAIL PROTECTED] wrote: : : First, context of hash slices: : : Hash slices with {} notation are trivially either scalars or lists: : : $h{'foo'} = want(); # Scalar : : $h{'foo','bar'} = want(); # List

Re: [pugs] Quoting constructs

2005-04-16 Thread Larry Wall
On Sat, Apr 16, 2005 at 03:14:50AM +0300, Roie Marianer wrote: : I actually knew that, but in my head $key_b and $value_b were single words. : But according to S02, the interpolation is protected by quotes. That is, if : $key_b is q0/printf Hello, world\n or die/, that's four words, correct? Or

Re: [] ugly and hard to type

2005-04-16 Thread Larry Wall
On Sat, Apr 16, 2005 at 02:42:25AM -0700, Ashley Winters wrote: : I never liked character sets. They introduced yet another exception to : the parsing rules, and it irked me. If it weren't for the need to : optimize character sets, I'd prefer to be Pythonized into using @{'a' : .. 'z'} : : If I

Re: Quoting interpolation in Perl5 vs. Perl6

2005-04-16 Thread Larry Wall
On Sat, Apr 16, 2005 at 06:28:37PM +0300, Roie Marianer wrote: : Hi all. : : I'm trying to get quoting interpolation to work, which means I first have to : understand it a little better. : : In Perl 5, as far as I can see, the delimiter of quoting constructs (whether : it's , '' or qq delim)

Re: Quoting interpolation in Perl5 vs. Perl6

2005-04-16 Thread Larry Wall
On Sat, Apr 16, 2005 at 11:30:49AM -0700, Larry Wall wrote: : The basic rule of thumb is that we pretend we're a top-down parser : even if we aren't, and we only look for the trailing delimiter when : we're not trying to parse something embedded that would naturally : slurp up the trailing

Re: Quoting interpolation in Perl5 vs. Perl6

2005-04-16 Thread Larry Wall
On Sat, Apr 16, 2005 at 10:16:43PM +0300, Roie Marianer wrote: : On Saturday 16 April 2005 10:10 pm, Larry Wall wrote: : So : this is a syntax error (of the runaway variety, presumably): : : @foo::bar::baz::fee::fie::foe[ : I was with you until that. What about : @foo::bar::baz::fee

Re: [] ugly and hard to type

2005-04-16 Thread Larry Wall
On Sat, Apr 16, 2005 at 10:01:44PM +0200, Juerd wrote: : Larry Wall skribis 2005-04-16 11:08 (-0700): : : $foo ~~ /@{ [ ] { } : ++ $ . ? / +| + ?| ? }/ : Not unless you backwhack that internal there. : [...] : @myfavoritepunctuations = [ ] { } \ : ++ $ . ? / +| + ?| ? ; : : Why isn't

Re: Comparing rationals/floats

2005-04-16 Thread Larry Wall
On Fri, Apr 15, 2005 at 04:18:51PM -0700, gcomnz wrote: : More questions stemming from cookbook work... Decimal Comparisons: : : The most common recipe around for comparisons is to use sprintf to cut : the decimals to size and then compare strings. Seems ugly. Certainly, but I don't think the

Re: $*CWD instead of chdir() and cwd()

2005-04-15 Thread Larry Wall
On Fri, Apr 15, 2005 at 03:11:59AM -0700, Michael G Schwern wrote: : Error handling is simple, a failed chdir returns undef and sets errno. : : $CWD = $dir err die Can't chdir to $dir: $!; Offhand, I guess my main semantic problem with it is that if a chdir fails, you aren't in an

Re: Macros [was: Whither use English?]

2005-04-15 Thread Larry Wall
On Fri, Apr 15, 2005 at 12:45:14PM +1200, Sam Vilain wrote: : Larry Wall wrote: : Well, only if you stick to a standard dialect. As soon as you start : defining your own macros, it gets a little trickier. : : Interesting, I hadn't considered that. : : Having a quick browse through some

Re: Truely temporary variables

2005-04-15 Thread Larry Wall
On Fri, Apr 15, 2005 at 11:45:16AM -0400, Aaron Sherman wrote: : Among the various ways of declaring variables, will Perl 6 have a way to : say, this variable is highly temporary, and may be re-declared within : the same scope, or in a nested scope without concern? I often find : myself doing: :

Re: Truely temporary variables

2005-04-15 Thread Larry Wall
On Fri, Apr 15, 2005 at 06:04:32PM +0200, Juerd wrote: : No, Ucfirst it can't be, I think. And ALLCAPS is ugly. @ is taken (and : ugly). Suggestions? Maybe we could define an ok operator that suppresses only the *first* warning produced by its argument(s). Then if you get multiple warnings, you

Re: should we change [^a-z] to -[a..z] instead of -[a-z]?

2005-04-15 Thread Larry Wall
On Fri, Apr 15, 2005 at 11:28:31AM -0500, Rod Adams wrote: : David Wheeler wrote: : : But the first person to write [a...] gets what's comin' to 'em. : : Is that nothing (since '.' lt 'a'), or everything after 'a'? Might as well make it everything after 'a' for consistency. One could also view

Re: Statement modifier scope

2005-04-15 Thread Larry Wall
I would like to get rid of all those implicit scopes. The only exception would be that any topicalizing modifier allocates a private lexical $_ scoped to just that statement. But dynamic scoping may happen only at explicit block boundaries. I can see the argument for the other side, where any

Re: $*CWD instead of chdir() and cwd()

2005-04-15 Thread Larry Wall
On Fri, Apr 15, 2005 at 01:12:46PM -0700, Michael G Schwern wrote: : Thus spake Larry Wall: : Offhand, I guess my main semantic problem with it is that if a chdir : fails, you aren't in an undefined location, which the new value of $CWD : would seem to indicate. You're just where you were

Re: nbsp in \s, ?ws and

2005-04-15 Thread Larry Wall
On Fri, Apr 15, 2005 at 11:44:03PM +0200, Juerd wrote: : Is there a ?ws-like thingy that is always \s+? Not currently, since \s+ is there. ?ws used to be that, but currently is defined as the magical whitespace matcher used by :words. : Do \s and ?ws match non-breaking whitespace, U+00A0? Yes.

Re: Heredocs: How equal are bunches of spaces to tabs?

2005-04-15 Thread Larry Wall
On Sat, Apr 16, 2005 at 12:11:24AM +0200, Juerd wrote: : Pasted from pugs/examples/cookbook/01-00introduction.p6: : : # XXX - question: How equal are bunches of spaces to tabs? : # -- I'd say that's a question for perl6lang This seems to be singularly short on context, but if it has to do

Re: nbsp in \s, ?ws and

2005-04-15 Thread Larry Wall
On Sat, Apr 16, 2005 at 12:46:47AM +0200, Juerd wrote: : Larry Wall skribis 2005-04-15 15:38 (-0700): : : Do \s and ?ws match non-breaking whitespace, U+00A0? : Yes. : : That makes \s+ and \s*, and thus ?ws very useless for anything but : trimming whitespace. For splitting (including word

Re: $*CWD instead of chdir() and cwd()

2005-04-15 Thread Larry Wall
On Fri, Apr 15, 2005 at 03:22:48PM -0700, Michael G Schwern wrote: : On Fri, Apr 15, 2005 at 11:52:38PM +0200, Juerd wrote: : becomes an unverifiable operation. You have to use chdir() if you want to : error check and $CWD is reduced to a scripting feature. : : Well, after failure it can

Re: Whither use English?

2005-04-14 Thread Larry Wall
On Thu, Apr 14, 2005 at 01:25:15PM +1200, Sam Vilain wrote: (B: Juerd wrote: (B: According to Wikipedia there are around 400 million native English (B: speakers and 600 million people who have English as a second language. (B: Should the remaining ~5.5 billion humans be exluded from writing

Re: subscripts are.... objects?

2005-04-14 Thread Larry Wall
On Tue, Apr 12, 2005 at 06:58:29PM +0300, Yuval Kogman wrote: : : We blitzed a discussion on #perl 3 minutes ago, reaching the : conclusion that negated subscripts are cool. : : So i was thinking: : : subscripts are objects. I'm all in favor of powerful constructs, but we need to be *really*

Re: Hyper operator corner case?

2005-04-14 Thread Larry Wall
On Thu, Apr 14, 2005 at 11:08:21AM -0600, John Williams wrote: : Good point. Another one is: how does the meta_operator determine the : identity value for user-defined operators? : : (1,2,3,4,5) my_infix_op (3,2,4) : : Maybe we should say that the excess length is simply copied unchanged. :

Re: subscripts are.... objects?

2005-04-14 Thread Larry Wall
On Thu, Apr 14, 2005 at 07:29:43PM +0200, Juerd wrote: : So, what's the important downside of all this? The fact that smartmatching a list doesn't slice, but is defined to be array equality with smartmatch of each element in order: if @array ~~ (1,2,3,many) { say array can count } Larry

should we change [^a-z] to -[a..z] instead of -[a-z]?

2005-04-14 Thread Larry Wall
In writing some character class translation, I realized that -[a-z] and its ilk are rather hard to read because of the two hyphens that mean different things. We can't use ![a-z] because that's a 0-width lookahead. Given that we're trying to get rid of special exceptions, and - in

Re: Question about list context for String.chars

2005-04-12 Thread Larry Wall
On Mon, Apr 11, 2005 at 03:53:32PM -0400, Mark Reed wrote: (B: I think that, in general, at the level of Perl code, 1 $B!H(Bcharacter$B!I(B should be (B: one code point, and any higher-level support for combining and splitting (B: should be outside the core, in Unicode::Whatever. (B (BI

Re: Blocks, continuations and eval()

2005-04-12 Thread Larry Wall
On Tue, Apr 12, 2005 at 11:36:02AM +0100, Piers Cawley wrote: : wolverian [EMAIL PROTECTED] writes: : : On Fri, Apr 08, 2005 at 12:18:45PM -0400, MrJoltCola wrote: : I cannot say how much Perl6 will expose to the high level language. : : That is what I'm wondering about. I'm sorry I was so

Re: Slicing conflict

2005-04-12 Thread Larry Wall
On Tue, Apr 12, 2005 at 12:08:43AM -0700, Brent 'Dax' Royal-Gordon wrote: : I was thinking about this today, actually, because my CS textbook was : talking about multidimensional arrays. If we make an infinite index : mean slice until you can slice no more, then we can possibly have a : Cterm:*

Re: Question about list context for String.chars

2005-04-12 Thread Larry Wall
On Mon, Apr 11, 2005 at 01:08:04PM -0700, gcomnz wrote: : I read followed by 0 or more combining characters to mean that it is : smart enough to combine the vowels in Arabic and other syllabic : alphabets that use special conjuncts. However I'm also not exactly : sure if that's even reasonably

Re: trim() and words() functions?

2005-04-12 Thread Larry Wall
On Tue, Apr 12, 2005 at 09:52:38PM -0500, Rod Adams wrote: : gcomnz wrote: : : Hey all, not sure if I'm just missing some obvious source of : information, but I used trim() as a function in a cookbook example, : then realized that it's not even in S29... : : There is a brief mention of trim(),

Re: identity tests and comparing two references

2005-04-06 Thread Larry Wall
On Wed, Apr 06, 2005 at 04:31:08PM +0200, Thomas Sandlaß wrote: : Larry Wall wrote: : Yes. It should complain that = is not a valid type signature. : Any foo (or foo:...) followed by ... should be parsed as a single : term selecting the function that MMD would dispatch to given that : type

Re: identity tests and comparing two references

2005-04-06 Thread Larry Wall
On Wed, Apr 06, 2005 at 10:07:33AM -0600, Luke Palmer wrote: : Thomas Sandlaß writes: : Larry Wall wrote: : Yes. It should complain that = is not a valid type signature. : Any foo (or foo:...) followed by ... should be parsed as a single : term selecting the function that MMD would dispatch

Re: identity tests and comparing two references

2005-04-06 Thread Larry Wall
On Mon, Apr 04, 2005 at 06:50:11PM +0200, Thomas Sandlaß wrote: : Juerd wrote: : And will Perl 6 reference values rather than their containers, that is: : will \$foo differ when $foo gets a new value, just as in Python id(foo) : changes after foo += 1? : : Depends on the definition of the

Re: identity tests and comparing two references

2005-04-06 Thread Larry Wall
On Wed, Apr 06, 2005 at 07:22:48PM +0200, Thomas Sandlaß wrote: : HaloO Larry, : : you wrote: : for ordinary functions. If it gets really popular people might : even start writing: : : sub foo :(Str,Int) {...} : : I like it, but that could mean it will not become popular :)) : And this is

Re: identity tests and comparing two references

2005-04-06 Thread Larry Wall
On Wed, Apr 06, 2005 at 08:24:23PM +0200, Juerd wrote: : Larry Wall skribis 2005-04-06 11:10 (-0700): : $$ref follow the ref list to the actual object. : : my $foo; : my $bar = \$foo; : my $quux = \$bar; : my $xyzzy = \$quux; : : How then, with only $xyzzy, do you get $bar

Re: identity tests and comparing two references

2005-04-06 Thread Larry Wall
On Wed, Apr 06, 2005 at 02:43:55PM -0500, Patrick R. Michaud wrote: : On Wed, Apr 06, 2005, Larry Wall wrote: : I think it's time to break out : the colon again and use something like: : : infix:+:(Complex, Complex); : : or : : foo:(Str,Int) : : for ordinary functions

Re: Second use of flattening

2005-04-05 Thread Larry Wall
On Mon, Apr 04, 2005 at 10:34:13PM -0400, Andrew Rodland wrote: : On Monday 04 April 2005 06:34 pm, Juerd wrote: : Terrence Brannon skribis 2005-04-04 18:45 (+): : So, to avoid confusion with the common understanding of flattening in : Perl, perhaps it should be called spreading or

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

2005-04-05 Thread Larry Wall
On Tue, Apr 05, 2005 at 04:00:09PM +0200, Thomas Sandlaß wrote: : Larry Wall wrote: : Roles cannot be derived from, so they're always final in that sense. : We should probably consider them closed by default as well, or at least : closed after first use. If a role specifies implementation, it's

Re: [S29] pick on other things than junctions

2005-04-05 Thread Larry Wall
On Tue, Apr 05, 2005 at 02:38:05PM +0200, Ingo Blechschmidt wrote: : Hi, : : Trey Harris wrote: : In a message dated Mon, 4 Apr 2005, Ingo Blechschmidt writes: : What does pick return on hashes? Does it return a random value or a : random pair? (I suppose returning a pair is more useful.) :

Re: Pugs Bug

2005-04-05 Thread Larry Wall
On Tue, Apr 05, 2005 at 09:36:18AM +0300, wolverian wrote: : (Replying to p6l instead of p6c as requested.) : : On Mon, Apr 04, 2005 at 10:39:16AM -0700, Larry Wall wrote: : (Now that builtins are just functions out in * space, we can probably : afford to throw a few more convenience functions

Re: Pugs Bug

2005-04-05 Thread Larry Wall
On Tue, Apr 05, 2005 at 07:31:40PM +0300, wolverian wrote: : Does [EMAIL PROTECTED] DWIM, by the way? I'm not sure about the precedence. That depends on whether you mean ([EMAIL PROTECTED]).words or ~(@array.words) It happens to mean the latter. A . binds tighter than a symbolic

Re: identity tests and comparing two references

2005-04-05 Thread Larry Wall
On Tue, Apr 05, 2005 at 06:38:43PM +0200, Thomas Sandlaß wrote: : Ups, a missing : warps this to a completly different meaning! : Comparing a coderef infix with the comparison operator = : to the word list 'Scalar of Ref of Ref of Int,Int'. : : I tried to ask what infix:=Scalar of Ref of Ref of

Re: :=: (OT)

2005-04-04 Thread Larry Wall
On Mon, Apr 04, 2005 at 03:55:23PM -0400, Aaron Sherman wrote: : but if you use vim or emacs inside a terminal, you'll want to make sure : it's in iso-latin-1 mode (e.g. in gnome-terminal, you have to use the : menu: Terminal-Set Character Encoding) If you going to that trouble, at least try your

Re: Definitive and Complete Perl 6 Operator List

2005-04-02 Thread Larry Wall
On Sat, Apr 02, 2005 at 01:49:24AM -0800, Brent 'Dax' Royal-Gordon wrote: : I've included assignment forms of all operators in the exponentiation, : multiplicative, additive, junctive, and tight logical levels; this may : be overkill or underkill. I've not included hyper forms of these :

Re: identity tests and comparing two references

2005-04-02 Thread Larry Wall
On Sat, Apr 02, 2005 at 11:06:01AM +0200, Juerd wrote: : Is your view of the world like Python or like Perl 5? Them's fightin' words. :-) : Values have no identity in Perl 5. That's slightly not true, insofar as Perl 5 distinguishes hash keys by value (albeit filtered through stringification).

Re: identity tests and comparing two references

2005-04-02 Thread Larry Wall
On Sat, Apr 02, 2005 at 11:22:43AM +0200, Leopold Toetsch wrote: : Larry Wall [EMAIL PROTECTED] wrote: : : On Thu, 2005-03-31 at 23:46 -0800, Darren Duncan wrote: : : : : In P6, an object is a data-type. It's not a reference, and any member : : payload is attached directly to the variable

Re: Documentary annotations: $what docwhy

2005-04-02 Thread Larry Wall
On Sat, Apr 02, 2005 at 03:19:33PM +0800, Sam Vilain wrote: : Luke Palmer wrote: : Supposing I had a doc trait, could I say: :sub f2c (Num $temp docTemperature in degrees F) :docConvert degress F to degrees C :{...} : Or would I be forced to spell it doc('stuff') ? : Well, first

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

2005-04-02 Thread Larry Wall
On Thu, Mar 31, 2005 at 01:11:37PM -0500, Aaron Sherman wrote: : If you declare a variable to be of a type (let's even say a class to be : specific), then you have hinted to the compiler as to the nature of that : variable, but nothing is certain. : : That is to say that the compiler cannot: : :

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

2005-04-02 Thread Larry Wall
On Thu, Mar 31, 2005 at 03:03:09PM +0200, Thomas Sandlaß wrote: : Larry Wall wrote: : On Sat, Mar 26, 2005 at 02:37:24PM -0600, Rod Adams wrote: : : How can you have a level independent position? : : By not confusing positions with numbers. They're just pointers into : a particular string

Re: use less in perl6?

2005-04-02 Thread Larry Wall
On Wed, Mar 30, 2005 at 10:20:28AM +0200, Yuval Kogman wrote: : How should this stuff be expressed? 'use less' is cute, but i don't : think it really gets there. It's mostly there as a placeholder for all the true pragmas that can be ignored if you don't understand them, an idea I originally

Re: New S29 draft up

2005-04-02 Thread Larry Wall
On Sat, Apr 02, 2005 at 11:27:09PM +0300, wolverian wrote: : On Mon, Mar 21, 2005 at 03:31:53PM +0100, Juerd wrote: : In fact, won't things be much easier if shift and pop workend on strings : as well as on arrays? Now that we have multis, this should be easy to : do. : : How about defining

Re: identity tests and comparing two references

2005-04-01 Thread Larry Wall
On Thu, Mar 31, 2005 at 11:46:22PM -0800, Darren Duncan wrote: : So, what is the operator for reference comparison? The =:= operator is almost certainly what you want here. Larry

Re: identity tests and comparing two references

2005-04-01 Thread Larry Wall
: On Thu, 2005-03-31 at 23:46 -0800, Darren Duncan wrote: On Fri, Apr 01, 2005 at 08:04:22AM -0500, Aaron Sherman wrote: : : What I want to be able to do is compare two references to see if they : point to the same thing, in this case an object, but in other cases : perhaps some other type

Re: identity tests and comparing two references

2005-04-01 Thread Larry Wall
On Fri, Apr 01, 2005 at 08:39:52AM -0700, Luke Palmer wrote: : I'm pretty sure that =:= does what you want. If you have two scalar : references, you might have to spell it like this: : : $$x =:= $$y Unnecessary, I think. I want $x =:= @y to tell me whether the reference in $x is to

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

2005-03-31 Thread Larry Wall
On Thu, Mar 31, 2005 at 06:35:06PM +0200, Thomas Sandlaß wrote: : Is typing optional in the sense that it is no syntax error but : otherwise ignored? To me this is pain but no gain :( Well, you guys keep ignoring the answer. Let me put it a bit more mathematically. The information in my X

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

2005-03-30 Thread Larry Wall
On Wed, Mar 30, 2005 at 09:40:26AM -0700, Luke Palmer wrote: : There _is_ a way to do it, actually, but we need to really screw around : with what kinds of things are inferred. In the case: : : my $a; : $a.m(1); : : We assign the type objects with an 'm' method that can take a single :

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

2005-03-30 Thread Larry Wall
On Wed, Mar 30, 2005 at 12:05:12PM +0200, Thomas Sandlaß wrote: : If I understand you correctly the use statement is more like a : linker/loader directive than a compile time interface include? That is up to the module being used. use is a linker, but it's only required to link enough

Re: .method == $self.method or $_.method?

2005-03-29 Thread Larry Wall
On Tue, Mar 29, 2005 at 06:38:31PM +0200, Juerd wrote: (B: Luke Palmer skribis 2005-03-29 6:14 (-0700): (B: method iterate () { (B: for (@.objs) { (B: .process($_); # oops (B: } (B: } (B: (B: There is an alarming similarity with (B: (B:

Re: String Theory

2005-03-28 Thread Larry Wall
On Mon, Mar 28, 2005 at 11:53:07AM -0500, Chip Salzenberg wrote: : According to Larry Wall: : On Fri, Mar 25, 2005 at 07:38:10PM -, Chip Salzenberg wrote: : : 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

Re: Units on numbers [was Re: S28ish]

2005-03-28 Thread Larry Wall
On Mon, Mar 28, 2005 at 03:40:14PM -0500, Aaron Sherman wrote: : Now you can ask for whatever you like: : : say We have {.new $money} : : Though you might have some snazzy way of saying that. Just by the by, that's illegal syntax. Methods with arguments require parens. You could,

Re: Units on numbers [was Re: S28ish]

2005-03-28 Thread Larry Wall
On Mon, Mar 28, 2005 at 01:30:14PM -0700, Craig DeForest wrote: : Yow -- units would be extra cool for perl6: I know of no other language that : has units support built in. It would go a long way toward making perl6 the : language of choice for students in the physical sciences... Well, yes.

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

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: 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 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

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: 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

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

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

2005-03-25 Thread Larry Wall
On Fri, Mar 25, 2005 at 10:27:53PM +1100, Adam Kennedy wrote: : Also, I saw another mention recently (possibly on TPF request for : donations) about the Perl 5 to Perl 6 converter, and it being 40% : completed? ... Larry? Well, by one reckoning it's 0% done. At the moment I'm just working on a

Re: Moving the p5 standard library to p6

2005-03-25 Thread Larry Wall
On Sat, Mar 26, 2005 at 12:05:06PM +1100, Andrew Savige wrote: : I noticed the Pugs folks have started porting File::Spec and : other modules to Pugs, which leads me to ask this question. : I've also taken a look at Rod Adams S29. : : There a quite a few p5 standard libraries with crusty old user

Re: Currying positionals

2005-03-24 Thread Larry Wall
On Wed, Mar 23, 2005 at 11:08:17PM +0200, Yuval Kogman wrote: : On Wed, Mar 23, 2005 at 11:53:06 -0800, Larry Wall wrote: : This seems a little backwards--I think all positionals should be bound : before you start binding named pairs, if currying is to be consistent with : ordinary binding

Re: Currying positionals

2005-03-24 Thread Larry Wall
On Thu, Mar 24, 2005 at 12:58:32PM -0800, Larry Wall wrote: : Note, the adverbial :{...} is defined as a named binding to the first : * parameter (or first *$ parameter if there isn't a slurpy *), so : it's already bound by Step C, even if it occurred later syntactically. Hmm, that's ambiguous

Re: Currying positionals

2005-03-24 Thread Larry Wall
On Thu, Mar 24, 2005 at 03:09:37PM -0700, Luke Palmer wrote: : Larry Wall writes: : Step A: For each positional parameter, if the next supplied argument is: : : 1) a non-pair : 2) a pair, and this parameter is explicitly declared Pair, or : 3) a hash, and this parameter

Re: Slices

2005-03-24 Thread Larry Wall
On Tue, Mar 22, 2005 at 05:18:44PM +0100, Thomas Sandlaß wrote: : Rod Adams wrote: : multi sub postcircumflex::[ ](MyArray $obj : [EMAIL PROTECTED]) is rw {...} : : but I'll wait for S14 before speculating further. : : Will that ever be written? And if yes, will it be like S13 which : is

Re: Precedence of where (of, is, will)?

2005-03-24 Thread Larry Wall
On Wed, Mar 23, 2005 at 06:58:51PM +0100, Thomas Sandlaß wrote: : Larry Wall wrote: : my @array of Int; : : is really short for : : my @array is Array of Int; : : How does 'is' relate to 'does'? I mean is the above @array : ready for operation? Yes, I think is typically implies

Re: New S29 draft up

2005-03-23 Thread Larry Wall
On Wed, Mar 23, 2005 at 03:28:31PM +, Peter Haworth wrote: : On Mon, 21 Mar 2005 08:41:27 -0800, Larry Wall wrote: : Okay, I've come around to liking it, but I think we have to say that : 0x, 0d, 0o, 0b, and whatever else we come up with are just setting : the default radix. If a string

Re: Questions regarding s/// and subst?

2005-03-23 Thread Larry Wall
On Wed, Mar 23, 2005 at 11:14:16AM -0500, Stevan Little wrote: : Is subst an object/type? : Or is it a method of the Str object? I suspect it's just a method, and the ~~ binding of s/// is merely syntactic sugar for the method call. : If it is an object ... : : Does s/// produce a

Re: New S29 draft up

2005-03-23 Thread Larry Wall
On Wed, Mar 23, 2005 at 07:33:43PM +0100, Thomas Sandlaß wrote: : Larry Wall wrote: : So we should probably : have a generalized radix_to_dec($radix,$input) function out there : somewhere instead. : : Why not shift it onto the type system: : : my Int $i = $input as Str[$radix] as Int; : : A bit

Re: Currying positionals

2005-03-23 Thread Larry Wall
On Wed, Mar 23, 2005 at 05:43:52PM +0200, Yuval Kogman wrote: : The algorithmic approach to binding some params: : : bind invocants : : bind named parameters, and keep leftover pairs for %_ : : treat nonpairs as positionals, and bind them sequentially. Left : over

Re: New S29 draft up

2005-03-21 Thread Larry Wall
On Sun, Mar 20, 2005 at 08:54:54PM -0600, Rod Adams wrote: Okay, I've come around to liking it, but I think we have to say that 0x, 0d, 0o, 0b, and whatever else we come up with are just setting the default radix. If a string comes in with an explicit 0x, 0d, 0o, or 0b, we believe that in

Re: Perl6 and Duff's Device

2005-03-21 Thread Larry Wall
On Sun, Mar 20, 2005 at 05:27:56PM -0700, Luke Palmer wrote: : I believe Perl 6 hasn't changed its policy on labels, so you should be : able to write that in Perl 6. But your behavior might be undefined. : It's weird to jump into the middle of a loop. We may only allow you to : jump outwards

Re: chr and ord

2005-03-21 Thread Larry Wall
On Sun, Mar 20, 2005 at 10:33:04PM -0600, Rod Adams wrote: : I'm thinking Cchr and Cord should be strictly Code Point level : activities, but I'm not sure. Alternately, since Num implies arbitrary precision, we *could* define a value that can hold as many code points as you like, mod 2**32 or

Re: nothing

2005-03-21 Thread Larry Wall
On Sun, Mar 20, 2005 at 09:08:08PM -0600, Rod Adams wrote: : Does Perl need a no-op function? : : With the addition of no bare literals, it makes constructs like : : 1 while some_func(); : : an error. Well, it's not a bareword--it's just potentially a useless use of the value in a void

Re: Precedence of where (of, is, will)?

2005-03-19 Thread Larry Wall
On Fri, Mar 18, 2005 at 09:36:49PM -0500, Chip Salzenberg wrote: : Nobody on #perl6 today could answer this one. Is: : Str | Int where { $_ } : the same as: : (Str | Int) where { $_ } : or: : Str | (Int where { $_ }) : ? where binds looser than |, but it's a member of a select group

Re: String Theory

2005-03-19 Thread Larry Wall
On Sat, Mar 19, 2005 at 05:07:49PM -0600, Rod Adams wrote: : I propose that we make a few decisions about strings in Perl. I've read : all the synopses, several list threads on the topic, and a few web : guides to Unicode. I've also thought a lot about how to cleanly define : all the string

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

2005-03-18 Thread Larry Wall
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 strikes again.

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

2005-03-18 Thread Larry Wall
On Fri, Mar 18, 2005 at 05:01:50AM -0600, Rod Adams wrote: : I'll try to come up with something decent, if no one beats me to it. : Sadly, the C style hex2int, oct2int might be the least confusing, but : heinously ugly. Yes, though there are two difficulties right there in the names: hardwiring

Re: New S29 draft up

2005-03-18 Thread Larry Wall
On Fri, Mar 18, 2005 at 08:21:07AM -0500, John Siracusa wrote: : On 3/18/05 12:18 AM, Larry Wall wrote: : Autochomping is one of the motivations for switching from while to : for for the normal line input method, since while might think a : blank line is false, while for only cares whether

Re: New S29 draft up

2005-03-18 Thread Larry Wall
On Fri, Mar 18, 2005 at 12:00:32PM -0500, John Macdonald wrote: : Generally when I do this I am not only deleting the character : from the string, but also moving it to another scaler to use; : so substr isn't a simple replacement because you'd have to : use it twice. Well, not lately. There's

Re: .method == $self.method or $_.method?

2005-03-18 Thread Larry Wall
On Thu, Mar 17, 2005 at 03:59:43PM -0800, Michael G Schwern wrote: : What it doesn't solve is the $.method vs .method issue. They look similar : but one works on the invocant and one works on $_. Still a trap. Yes, and that's probably the killer of the oc idea. So much for Sleep Brain, heh,

Re: Referencing a caller's slurpy array.

2005-03-17 Thread Larry Wall
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 where an ordinary

Re: .method == $self.method or $_.method?

2005-03-17 Thread Larry Wall
On Thu, Mar 17, 2005 at 07:00:08PM +1100, Adam Kennedy wrote: : Personally, .foo meaning $self.foo seems more consistent to my mind, and : I'd happily standardise on implicit invocants. I'm thinking about it. There are definitely things to be said for both sides, and maybe we can come up with a

Re: return of copies vs references

2005-03-17 Thread Larry Wall
On Thu, Mar 17, 2005 at 02:06:46AM -0700, Luke Palmer wrote: : I'll just point out, the rest of this message, with all the autocopy : complexity (according to /some/ people), uses this assumption. It all : happily goes away if $self.:bar returns a list if @:bar is declared. : And I can't, off

Re: .method == $self.method or $_.method?

2005-03-17 Thread Larry Wall
I've been thinking about this in my sleep, and at the moment I think I'd rather keep .foo meaning $_.foo, but break the automatic binding of the invocant to $_. Instead of that, I'd like to see a really, really short alias for $self. Suppose we pick o for that, short for object. Then we get

<    8   9   10   11   12   13   14   15   16   17   >