Re: Quick questions: multi submethod and undef.method

2005-06-08 Thread Larry Wall
On Sun, Jun 05, 2005 at 10:22:16PM +0200, Ingo Blechschmidt wrote: : Hi, : : two quick questions: : : : Are multi submethods allowed? Presumably. : my $x = undef; : my $y = $x.some_method; : # $y now contains an unthrown exception object, saying that undef : # doesn't .can("some_method

Re: reduce metaoperator on an empty list

2005-06-08 Thread Larry Wall
On Tue, Jun 07, 2005 at 10:52:55PM +, Luke Palmer wrote: : Okay, I was referring more to the implementation. How do we tell apart: : : 3 < 4 <= 5 == 5 : : From : : 3 lt 4 >= 5 != 5 : : ? As long as the actual arguments aren't allowed to be lazy/thunky/iteratey, they can just be ev

Re: reduce metaoperator on an empty list

2005-06-08 Thread Larry Wall
On Wed, Jun 08, 2005 at 11:40:49AM +0200, "TSa (Thomas Sandlaß)" wrote: : Damian Conway wrote: : >So, to clarify again, if $var is undefined, then the assignment: : > : >$var op= $value; : > : >is equivalent to: : > : >$var = (&op.does(identval) ?? &op.identval() :: undef) op $value; : > :

Re: return() in pointy blocks

2005-06-08 Thread Larry Wall
On Wed, Jun 08, 2005 at 12:37:22PM +0200, "TSa (Thomas Sandlaß)" wrote: : BTW, is -> on the 'symbolic unary' precedence level : as its read-only companion \ ?. No, -> introduces a term that happens to consist of a formal signature and a block. There are no ordinary expressions involved until you

Re: reduce metaoperator on an empty list

2005-06-07 Thread Larry Wall
On Tue, Jun 07, 2005 at 09:41:49PM +, Luke Palmer wrote: : < and > still don't make sense as reduce operators. Yeah, I keep confusing them with min and max. : That reminds me, how are <, >, etc. defined anyway? How can we tell : them to be list-associative with each other? Because they're a

Re: reduce metaoperator on an empty list

2005-06-07 Thread Larry Wall
Okay, I've made up my mind. The "err" option is not tenable because it can cloak real exceptions, and having multiple versions of reduce is simply multiplying entities without adding much power. So let's allow an optional "identvalue" trait on operators. If it's there, reduce can use it. If it'

Re: What the heck is... wrong with Parrot development?

2005-06-06 Thread Larry Wall
On Mon, Jun 06, 2005 at 04:31:01PM +0200, anonymous coward wrote: : It's a funny old world... : wrote Dan Sugalski on June 04, 2005 in his Squawks of the Parrot blog. : Go and see: . : : Hence the subject. : : What the heck is wrong with Parrot

Re: construction clarification

2005-05-31 Thread Larry Wall
On Mon, May 30, 2005 at 05:00:26PM +0100, Carl Franks wrote: : I have a class that normally takes a list of named arguments. : I also want to be able to handle a single argument. : : class Foo { : multi method new (Class $class: Str $date) { : return $class.bless(date => $date); : } : :

Re: Default invocant of methods

2005-05-31 Thread Larry Wall
On Fri, May 27, 2005 at 10:59:25PM +0200, Ingo Blechschmidt wrote: : Hi, : : what is the default invocant of methods? : : method blarb ($normal_param) {...} : # Same as : method blarb (Class | ::?CLASS $invocant: $normal_param) {...} : # or : method blarb (::?CLASS $invocant: $normal_pa

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

2005-05-31 Thread Larry Wall
On Tue, May 31, 2005 at 03:42:42PM -0700, Larry Wall wrote: : On Wed, May 25, 2005 at 07:07:02PM -0400, Uri Guttman wrote: : : the only advantage in the above case is the different prececences of = : : and <== which allows dropping of parens with the latter. i don't : : consider that so i

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

2005-05-31 Thread Larry Wall
On Wed, May 25, 2005 at 07:07:02PM -0400, Uri Guttman wrote: : the only advantage in the above case is the different prececences of = : and <== which allows dropping of parens with the latter. i don't : consider that so important a win as to be used often. and they are at : equal huffman levels as

Re: Sub call resolution

2005-05-31 Thread Larry Wall
On Mon, May 30, 2005 at 08:39:57AM +, Luke Palmer wrote: : Okay, I'd like to set myself straight. Sanity check: : : bar($foo, $baz); # looks for subs (lexical then package), and : falls back to MMD Er, no. : $foo.bar($baz);# looks in ref($foo), then falls back to MMD : : If t

Re: comprehensive list of perl6 rule tokens

2005-05-31 Thread Larry Wall
On Thu, May 26, 2005 at 11:19:42AM -0500, Patrick R. Michaud wrote: : Do we still have the <> syntax, or was that abandoned in : favor of ? (I know there are still some remnants of <<...>> : in S05 and A05, but I'm not sure they're intentional.) It's gone, though we're reserving it for something

Re: reduce metaoperator on an empty list

2005-05-31 Thread Larry Wall
On Mon, May 23, 2005 at 08:54:19PM +, [EMAIL PROTECTED] wrote: : : There are actuall two usefull definition for %. The first which Ada calls 'mod' always returns a value 0<=X

Re: Closures and CALLER

2005-05-17 Thread Larry Wall
On Tue, May 17, 2005 at 01:01:48PM -0500, Rod Adams wrote: : Aaron Sherman wrote: : : >Ok, so log and log10: : > : >multi sub Math::Basic::log (: Num ?$x = $CALLER::_, Num +$base); : >&log10<> := &log<>.assuming:base(10); : > : >What does log get in this case: : > : > for @x {

Re: Multiple colons

2005-05-17 Thread Larry Wall
On Wed, May 18, 2005 at 04:02:16AM +0800, Autrijus Tang wrote: : Hmm. How does this play with Larry's suggestion: : : I suppose one could even install a colon on the end of the return : type to request that explicitly. : : Does it mean that: : : multi sub foo(Foo: Bar: Baz:) returns

Re: Quick question: '1.28' * '2.56'

2005-05-17 Thread Larry Wall
On Tue, May 17, 2005 at 09:04:19PM +0800, Autrijus Tang wrote: : Imagine: : : pugs> '1.28' * '2.56' : 3.2768 : : What is (or should be) going on here here? : : [1] role NumRole { : method infix:<*> returns Num (NumRole $x, NumRole $y: ) { ... } : } : Str.does(NumRole); : :

Re: Multiple colons

2005-05-17 Thread Larry Wall
On Tue, May 17, 2005 at 10:10:22PM +0800, Autrijus Tang wrote: : On Tue, May 17, 2005 at 07:00:23AM -0700, Larry Wall wrote: : > On Tue, May 17, 2005 at 01:50:48PM +, Luke Palmer wrote: : > : Is that still the case? I don't recall us getting rid of it, but it : > : does

Re: Multiple colons

2005-05-17 Thread Larry Wall
On Tue, May 17, 2005 at 01:50:48PM +, Luke Palmer wrote: : Hey grep { !/Luke/ } @Larry, : : multi foo(Foo, Bar: Baz); # manhattan on Foo and Bar : multi foo(Foo: Bar: Baz); # leftmost on Foo and Bar : wtf? : multiple colons? : : Is that still the case? I don't r

Re: not 4,3,2,1,0;

2005-05-17 Thread Larry Wall
On Tue, May 17, 2005 at 02:42:43PM +0800, Autrijus Tang wrote: : On Mon, May 16, 2005 at 04:06:15PM -0700, Larry Wall wrote: : > That's : > : > sub not (*args is context(Scalar)) : > : > or whatever we end up calling the Any/Scalar type. : : How about is context(Ite

Re: not 4,3,2,1,0;

2005-05-16 Thread Larry Wall
On Tue, May 17, 2005 at 05:32:27AM +0800, Autrijus Tang wrote: : Ok, but I'm still not too sure about what signature will Perl 6's ¬ : have, that can impose singular context on each of its argument (so that : not(@foo) won't flatten), but still accept an unlimited number of : arguments. It's somet

Re: not 4,3,2,1,0;

2005-05-16 Thread Larry Wall
On Tue, May 17, 2005 at 01:48:20AM +0800, Autrijus Tang wrote: : This evaluates to 1 in Perl 5: : : not 4,3,2,1,0; : : Namely, the "not" listOp is taking the last of a variadic, non-slurpy : argument list, boolify it, and return its negation. : : What is the Perl 6 signature that correspond

Re: Roles and BUILD

2005-05-16 Thread Larry Wall
On Mon, May 16, 2005 at 03:10:10PM +, Ingo Blechschmidt wrote: : my MyBot $bot .= new; : # Are IRC::Bot::JoinOnInvite::BUILD and : # IRC::Bot::SayHelloOnJoin::BUILD called? Yes, role BUILD submethods are magically composed into the class's BUILD method somehow (or at least called at t

Re: BUILD and other submethods

2005-05-16 Thread Larry Wall
On Mon, May 16, 2005 at 02:59:11PM +, Ingo Blechschmidt wrote: : Hi, : : class Foo { : submethod BUILD() { : say 42; : } : } : : class Bar is Foo { : submethod BUILD() { : say 23; : } : } : : my Bar $bar .= new; : : I suppose this will o

Re: Plethora of operators

2005-05-16 Thread Larry Wall
On Mon, May 16, 2005 at 10:18:47AM +0300, Markus Laire wrote: : As S09 says that: : : At the statement level, a semicolon terminates the current : expression. Within any kind of bracketing construct, semicolon : notionally produces a list of lists, the interpretation of which : dep

Re: junctions vs English negatives.

2005-05-15 Thread Larry Wall
On Mon, May 16, 2005 at 10:37:13AM +1000, Damian Conway wrote: : Luke wrote: : : >Hmm. I'll just [mention] that if != is implemented like this: : > : >multi sub infix: (Any|Junction $a, Any|Junction $b) { : >!($a == $b); : >} : > : >Then it Just Works. : : I'd be fine with the dw

Re: ./method

2005-05-15 Thread Larry Wall
On Sun, May 15, 2005 at 08:54:52PM -0400, Matt Diephouse wrote: : Damian Conway <[EMAIL PROTECTED]> wrote: : > Larry Wall wrote: : > : > > On Sun, May 15, 2005 at 12:22:07PM -0400, Matt Diephouse wrote: : > > : Does this mean private methods will be called like this? : &

Re: ./method

2005-05-15 Thread Larry Wall
On Sun, May 15, 2005 at 06:34:47PM +0200, Juerd wrote: : .:method # $_.:method It is almost certainly the case that you can't call a private method of $_ unless it just happens to have trusted you, and since it's such an unusual thing, calling into another class's private method should have

Re: ./method

2005-05-15 Thread Larry Wall
On Sun, May 15, 2005 at 08:30:06PM -0400, Rob Kinyon wrote: : On 5/15/05, Juerd <[EMAIL PROTECTED]> wrote: : > Brad Bowman skribis 2005-05-16 9:56 (+1000): : > > Would it conflict with range + pattern? Or has that changed anyway? : > : > No, "./" and "../" are prefix only, so they cannot clash w

Re: ./method

2005-05-15 Thread Larry Wall
On Sun, May 15, 2005 at 12:22:07PM -0400, Matt Diephouse wrote: : Does this mean private methods will be called like this? : : ./:method() No, I think that's still just .:method() Larry

Re: ./method

2005-05-15 Thread Larry Wall
On Sun, May 15, 2005 at 01:44:44PM +0200, Juerd wrote: : A few days ago, when typing ./pugs,... You can guess the rest :) : : I suggest : : ./method : : to mean $?SELF.method, and : : ../method : : to mean $?SELF.SUPER::method, or however that's normally written. That's almost termina

Re: Plethora of operators

2005-05-14 Thread Larry Wall
On Sat, May 14, 2005 at 01:36:22PM -0500, Rod Adams wrote: : Larry Wall wrote: : : >On Sat, May 14, 2005 at 12:51:32PM -0500, Rod Adams wrote: : > : >: Unless, of course, there is some subtle difference between a 3-d hash : >: and a hash of hashes of hashes that invalidates thi

Re: Plethora of operators

2005-05-14 Thread Larry Wall
On Sat, May 14, 2005 at 12:51:32PM -0500, Rod Adams wrote: : Larry Wall wrote: : : >On Sat, May 14, 2005 at 06:41:35PM +0200, Juerd wrote: : >: Larry Wall skribis 2005-05-14 9:20 (-0700): : >: > Possibly. Or we just define infix .{}. and .[]. variants, or some : >such. : >:

Re: Plethora of operators

2005-05-14 Thread Larry Wall
On Sat, May 14, 2005 at 06:41:35PM +0200, Juerd wrote: : Larry Wall skribis 2005-05-14 9:20 (-0700): : > Possibly. Or we just define infix .{}. and .[]. variants, or some such. : : The problem is that we already have @foo[] meaning the same as @foo, and : an always allowed . that also all

Re: BEGIN and lexical variables inside subroutines

2005-05-14 Thread Larry Wall
On Fri, May 13, 2005 at 04:21:25PM +0200, "TSa (Thomas Sandlaß)" wrote: : And I hope that it is not possible to accidentially : mess up the internals of the compiler because code : in a BEGIN hits compiler data. Whereas I hope that it *is* possible to intentionally mess up the internals of the com

junctions vs English negatives.

2005-05-14 Thread Larry Wall
We have a bit of a problem with negative operators applied to junctions, as illustrated recently on PerlMonks. To wit, when a native English speaker writes if $a != 1 | 2 | 3 {...} they really mean one of: if not $a == 1 | 2 | 3 {...} if $a == none(1, 2, 3) {...} or, expressed in

Re: Plethora of operators

2005-05-14 Thread Larry Wall
On Sat, May 14, 2005 at 10:55:43AM -0500, Jonathan Scott Duff wrote: : But perhaps the reduce operator is some of that sufficiently advanced : technology that "knows" how the operator it wraps is slotted and does : something appropriate. Possibly. Or we just define infix .{}. and .[]. variants,

Re: ^method ?

2005-05-14 Thread Larry Wall
On Sat, May 14, 2005 at 04:22:44PM +1000, Adam Kennedy wrote: : >The obvious way to do it is to declare the invocant. : : Wasn't one of the original headline features for Perl 6 not having to do : that any more for basic normal code? Or at least from a couple of damian : talks it was one of the

Re: ^method ?

2005-05-14 Thread Larry Wall
On Sat, May 14, 2005 at 02:17:38PM +0200, Juerd wrote: : Firstly, thanks for writing the message out so clearly that it cannot be : misunderstood. : : Damian Conway skribis 2005-05-14 22:06 (+1000): : > .{width} //= 80; : > .{height}//= 24; : > .{gutter}

Re: Object Numify/Stringify-ing to Unique values

2005-05-14 Thread Larry Wall
On Sat, May 14, 2005 at 02:57:53PM +0200, Leopold Toetsch wrote: : If we want some interoperbility with Python dicts, hashing will not be : done on ids but on the hash function of the type. Which Perl could default to id. Larry

Re: The [] metaoperator

2005-05-14 Thread Larry Wall
On Sat, May 14, 2005 at 10:53:38PM +0800, Autrijus Tang wrote: : On Sat, May 14, 2005 at 10:56:29PM +1000, Damian Conway wrote: : > 8. To verify the monotonicity of a sequence: : > : >$is_monotonic = [<] @numbers; : : Hey. Does this mean that the [] metaoperator folds with the :

Re: ^method ?

2005-05-13 Thread Larry Wall
On Sat, May 14, 2005 at 04:33:44AM +, Luke Palmer wrote: : On 5/14/05, Luke Palmer <[EMAIL PROTECTED]> wrote: : > On 5/14/05, Larry Wall <[EMAIL PROTECTED]> wrote: : > > At the moment $?SELF is the only canonical form, though the invocant : > > is also in $_ at lea

Re: Object Numify/Stringify-ing to Unique values

2005-05-13 Thread Larry Wall
On Sat, May 14, 2005 at 10:54:34AM +0800, Autrijus Tang wrote: : On Fri, May 13, 2005 at 07:28:03PM -0700, Larry Wall wrote: : > That's what .id is supposed to do, without the bogus numorstringification : > semantics. It should return something opaque that matches with ~~. : : Okay,

Re: ^method ?

2005-05-13 Thread Larry Wall
On Sat, May 14, 2005 at 11:41:23AM +0800, Autrijus Tang wrote: : Juerd informed me today that .method should still means $_.method. : : However, for the OO modules we're writing, there still needs to be a way : to invoke methods on the current invocant, when the invocant name has : been omitted fr

Re: Object Numify/Stringify-ing to Unique values

2005-05-13 Thread Larry Wall
On Fri, May 13, 2005 at 09:47:52PM -0400, Stevan Little wrote: : Hello all. : : In the processing of working with mugwump's shiny new perl6 OO Set.pm. : I realized that we do not currently have a way to uniquely identify : objects in Pugs like the way we have in perl5 (object stringification).

Re: C<::> in rules

2005-05-13 Thread Larry Wall
On Sat, May 14, 2005 at 01:15:36AM +, Luke Palmer wrote: : I think the misunderstanding is rather simple. You keep talking like : you prepend a .*? to the rule we're matching. I think that's wrong : (and this is where I'm making a design call, so we can dispute on this : once we're clear that

Re: single element lists

2005-05-13 Thread Larry Wall
On Thu, May 12, 2005 at 11:52:38PM +0200, James Mastros wrote: : Larry Wall wrote: : > : If yes, then (1)[0] means the same as 1.[0] and 1.[0][0][0]. If no, : > : (1)[0] is a runtime error just like 1.[0] -- i.e. unable to find the : > : matching .[] multisub under Int or its sup

Re: trait and properties thru getter/setters

2005-05-13 Thread Larry Wall
On Fri, May 13, 2005 at 09:40:51PM +0200, Stéphane Payrard wrote: : And what about the getter part of my question? :) A12 discusses the relationship of traits and properties in great detail. Any trait's metadata can be stored as properties at compile time, and such metadata can be retrieved as pr

Re: trait and properties thru getter/setters

2005-05-13 Thread Larry Wall
On Fri, May 13, 2005 at 12:56:19PM -0700, Brent 'Dax' Royal-Gordon wrote: : Should I construe the fact that you didn't comment on the ::() to mean : that the symref syntax works here? Offhand I don't see any reason for it not to. Larry

Re: C<::> in rules

2005-05-13 Thread Larry Wall
On Fri, May 13, 2005 at 11:54:47AM -0500, Patrick R. Michaud wrote: : $r1 = rx / abc :: def | ghi :: jkl | mn :: op /; : $r2 = rx / abc ::: def | ghi ::: jkl | mn ::: op /; : $r3 = rx / [ abc :: def | ghi :: jkl | mn :: op ] /; I would prefer that $r1 work like $r3, not like $r2, for t

Re: trait and properties thru getter/setters

2005-05-13 Thread Larry Wall
On Fri, May 13, 2005 at 12:26:22PM -0700, Brent 'Dax' Royal-Gordon wrote: : Well, the value's pretty easy--just pass in a variable: : : my $b = $a is foo($bar); As we currently have it, that is not legal syntax. "is" may only be applied to declarations. You must use "does" or "but" to mixin

Re: C<::> in rules

2005-05-13 Thread Larry Wall
On Fri, May 13, 2005 at 11:43:42AM +0300, Markus Laire wrote: : Perhaps spec should be changed so that :p means :p(bool::true) or :p(?1) : and not :p(1) I'm still not sure I believe in booleans to that extent. I suppose we could go as far as to make it :p(0 but true). Actually, it's more like "

Re: character classes in p6 rules

2005-05-12 Thread Larry Wall
On Wed, May 11, 2005 at 08:00:20PM -0500, Patrick R. Michaud wrote: : Somehow I'd like to get rid of those inner angles, so : that we always use <+alpha>, <+digit>, <-sp>, <-punct> to : indicate named character classes, and specify combinations : with constructions like <+alpha+punct-[aeiou]>

Re: C<::> in rules

2005-05-12 Thread Larry Wall
On Thu, May 12, 2005 at 09:33:37AM -0500, Patrick R. Michaud wrote: : Also, A05 proposes incorrect alternatives to the above : : /[:w[]foo bar]/# null pattern illegal, use : /[:w()foo bar]/# null capture illegal, and probably undesirable : /[:w\bfoo bar]/# not exactly the

Re: Numification of captured match

2005-05-12 Thread Larry Wall
On Fri, May 13, 2005 at 02:00:10PM +1000, Damian Conway wrote: : >Actually, it's not clear to me offhand why @1 shouldn't mean $1[] : >and %1 shouldn't mean $1{}. : : It *does*. According to the recent capture semantics document: : :> Note that, outside a rule, C<@1> is simply a shorthand for

Re: Question on "is chomped"

2005-05-12 Thread Larry Wall
On Thu, May 12, 2005 at 02:52:01PM -0400, Joshua Gatcomb wrote: : While E02 states that "is chomped" sets the chomped property of : afilehandle, I didn't find any detailed specifications in any of the : As or Ss. : : So - is "is chomped" always the equivalent of: : : while ( ) { : chomp; : }

Re: Numification of captured match

2005-05-12 Thread Larry Wall
On Thu, May 12, 2005 at 02:55:36PM -0500, Patrick R. Michaud wrote: : On Fri, May 13, 2005 at 03:23:20AM +0800, Autrijus Tang wrote: : > Is it really intended that we get into habit of writing this? : > : > if 'localhost:80' ~~ /^(.+)\:(\d+)$/ { : > my $socket = connect(~$0, +$1); : >

Re: split /(..)*/, 1234567890

2005-05-12 Thread Larry Wall
On Thu, May 12, 2005 at 12:03:55PM -0500, Jonathan Scott Duff wrote: : I think that the above split should generate a list like this: : : ('', [ '12','34','56','78','90']) Yes, though I would think of it more generally as ('', $0, '', $0, '', $0, ...) where in this case it just happen

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

2005-05-11 Thread Larry Wall
On Wed, May 11, 2005 at 06:24:38PM -0400, Aaron Sherman wrote: : I'm confused as well. How does that play with Larry's comment: : : http://groups-beta.google.com/group/perl.perl6.language/browse_frm/thread/54a1135c012b97bf/d17b4bc5ae7db058?q=list+comma&rnum=5&hl=en#d17b4bc5ae7db058 Well, that ap

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

2005-05-11 Thread Larry Wall
On Thu, May 12, 2005 at 07:04:48AM +0800, Autrijus Tang wrote: : Please sanity-check. :-) Looks good to me. Though that should perhaps not be confused with sanity. Larry

Re: single element lists

2005-05-11 Thread Larry Wall
On Thu, May 12, 2005 at 05:19:11AM +0800, Autrijus Tang wrote: : Sure (and done). Now that #1 is eliminated, the question is now : whether a simple scalar can be treated as a small (one-element) array : reference, much like a simple pair can be treated as a small : (one-element) hash reference. :

Re: single element lists

2005-05-11 Thread Larry Wall
On Thu, May 12, 2005 at 04:19:02AM +0800, Autrijus Tang wrote: : Hm? Under #2, no matter whether @foo is (1) or (1,2), the construct : (@foo)[0] would always means @foo.[0]. Not sure how the length of @foo : matters here. Tell you what, let's require P5's (...)[] to be translated to [...][], so

Re: single element lists

2005-05-11 Thread Larry Wall
On Wed, May 11, 2005 at 11:45:12AM -0500, Jonathan Scott Duff wrote: : : We're discussing the proper semantics of (1)[0] on #perl6. Here's : where we're at so far: : : 1. specialise ()[] to parse as (,)[] : 2. scalars are singleton lists, so ()[] naturally : 3. make (1)[0] die horribly. : : We a

Re: Nested captures

2005-05-11 Thread Larry Wall
On Wed, May 11, 2005 at 06:35:36PM +0200, Juerd wrote: : Larry Wall skribis 2005-05-11 8:30 (-0700): : > It's already the case that p5-to-p6 is going to have a *wonderful* : > time translating $7 to $1[2][0]... : : If I remember correctly, ** recursively flattens, and so (**$/)[7-

Re: Nested captures

2005-05-11 Thread Larry Wall
On Wed, May 11, 2005 at 05:48:59PM +1000, Damian Conway wrote: : But that's only the opinion of one(@Larry), not of $Larry. Let's go 0-based and make $0 =:= $/[0] so that $/[] is all the parens. Our old $0 (P5's $&) could be $<> instead, short for $ or some such. It's already the case that p5-to-

Re: Scoping of $/

2005-05-10 Thread Larry Wall
On Tue, May 10, 2005 at 05:24:30PM -0400, Rick Delaney wrote: : On Tue, May 10, 2005 at 06:20:44AM -0600, Luke Palmer wrote: : > Yeah, they're lexical, just like in Perl 5. : : Not just like Perl 5, I hope. If it was then the above would print : "d". Yes, Perl 5 actually uses an autolocalizing f

Re: Nested captures

2005-05-09 Thread Larry Wall
On Mon, May 09, 2005 at 12:14:35PM -0700, Larry Wall wrote: : On Mon, May 09, 2005 at 02:08:31PM -0500, Patrick R. Michaud wrote: : : Hmmm, then would $x.$j.2 then be equivalent to $x[$j-1][1] ? : : Ouch. Maybe that's a good reason to switch from 1-based to 0-based $ vars. Not sure what

Re: Nested captures

2005-05-09 Thread Larry Wall
On Mon, May 09, 2005 at 02:08:31PM -0500, Patrick R. Michaud wrote: : Hmmm, then would $x.$j.2 then be equivalent to $x[$j-1][1] ? Ouch. Larry

Re: Nested captures

2005-05-09 Thread Larry Wall
On Mon, May 09, 2005 at 10:33:33AM -0500, Patrick R. Michaud wrote: : After thinking on this a bit, I'm hoping we don't do this -- at least not : initially. I'm not sure there's a lot of advantage of C< $1.1 > over : C< $1[0] >, and one starts to wonder about things like $1.$j.2 and : $1[$j].2 a

Re: Nested captures

2005-05-09 Thread Larry Wall
On Mon, May 09, 2005 at 10:33:33AM -0500, Patrick R. Michaud wrote: : > =head2 Subpattern numbering : > [...] : > Of course, the leading Cs that Perl 5 would produce do convey : > (albeit awkwardly) which alternative actually matched. If that : > information is important, Perl 6 has several far cle

Re: Nested captures

2005-05-09 Thread Larry Wall
On Mon, May 09, 2005 at 09:47:14AM -0600, Paul Seamons wrote: : > =item * : > : > Quantifiers (except C and C) cause a matched subrule or subpattern to : > return an array of C objects, instead of just a single object. : : What is the effect of the quantifiers C<**{0,1}> and C<**{0,1}?> ? That wo

Re: Overriding/redefining p6 built-in functions

2005-05-08 Thread Larry Wall
On Sun, May 08, 2005 at 02:39:03PM +1000, Andrew Savige wrote: : A crude hack sometimes used by gung ho p5 testers is to redefine : perl built-in functions. For example: : : BEGIN { : *CORE::GLOBAL::read = sub (*\$$;$) { return undef }; : } : : to test read failures (and so boost your Devel::

Re: Clarification of behavior for .isa() on built-in types

2005-05-07 Thread Larry Wall
On Sat, May 07, 2005 at 01:09:52PM -0400, Stevan Little wrote: : Hello All, : : So I am expanding our .isa() tests for built-in datatypes (in : particular Array), and I have a few (probably very simple) questions : (since I cannot seem to find details on this anywhere). : : Is there an isa() bu

Re: available operator characters

2005-05-07 Thread Larry Wall
On Sat, May 07, 2005 at 02:23:15PM +0200, Juerd wrote: : Matt Creenan skribis 2005-05-07 1:47 (-0400): : > I thought about $blockname <= { ... }, but <= is obviously taken, as is <== : > $blockname <=: for 1..5 { : > $blockname :=> for 1..5 { : > } $blockname; : > } <=: $blockname;

Re: reduce metaoperator

2005-05-07 Thread Larry Wall
On Sat, May 07, 2005 at 01:00:08PM -0700, Larry Wall wrote: : On the other hand, since we've distinguished hyperops on infixes from : hyperops on unaries, maybe an infix hyperop in unary position just : does the thing to itself: : : @squares = »*« @list; : : which gives us a sum-of-sq

Re: reduce metaoperator

2005-05-07 Thread Larry Wall
On Sat, May 07, 2005 at 05:11:19PM +1000, Stuart Cook wrote: : On 5/7/05, Patrick R. Michaud <[EMAIL PROTECTED]> wrote: : > It might not be a problem -- I'm thinking we may end up tokenizing : > most or all of the meta operators, so that [+] would be considered : > its own token, and then the "long

Re: available operator characters

2005-05-06 Thread Larry Wall
On Fri, May 06, 2005 at 06:24:00PM +0200, Juerd wrote: : {} href|closure hash (deref+)subscript (no ws) : {}? (clash) AVAILABLE (ws) s/AVAILABLE/statement block/ Actually, I'd try to find a way to combine all the paired ws-dependent entries onto the same lin

Re: available operator characters

2005-05-06 Thread Larry Wall
On Fri, May 06, 2005 at 10:43:07AM -0600, Luke Palmer wrote: : > :: namespace ternary : : That's "class sigil" in term position. Separating namespaces never : have preceding whitespace, so they're always part of some larger term. Really more like a package sigil, which can be u

Re: Fwd: Re: Pugs 6.2.0 released.

2005-05-06 Thread Larry Wall
On Sat, May 07, 2005 at 02:04:45AM +0200, Juerd wrote: : Juerd skribis 2005-05-07 1:23 (+0200): : > Perl 5's perlop says: "It cannot short circuit, of course." Can : > someone explain why it cannot? : : I was confused. It is entirely obvious why it can't. On the other hand, one(...) semantics ca

Re: stdio

2005-05-06 Thread Larry Wall
On Fri, May 06, 2005 at 08:19:05AM -0400, Aaron Sherman wrote: : "open" as a verb is extremely ambiguous. In dictionary searches I see as : many as 19 definitions just for the verb form. Well, sure, but also need to take Perl history into account, where dwimmy open is considered something of a lia

Re: bitter complaints

2005-05-06 Thread Larry Wall
On Fri, May 06, 2005 at 06:46:58PM +0200, Juerd wrote: : According to S03, the yada operator "complains bitterly" when used. In : #perl6, we can't agree on what that means. Please help. Does it die, : warn or fail? : : 18:46 < Corion> Juerd: "Complain bitterly" is "output a warning" to me. : 18:46

Re: available operator characters

2005-05-06 Thread Larry Wall
On Fri, May 06, 2005 at 11:25:31AM -0700, Larry Wall wrote: : Any Object does Hash, and treats any argumentless method as a potential : hash key. I should also point out that the main reason for this is to allow easier translation of Perl 5 idioms to Perl 6 without having to guess whether $foo

Re: available operator characters

2005-05-06 Thread Larry Wall
On Fri, May 06, 2005 at 06:49:44PM +0200, Juerd wrote: : Luke Palmer skribis 2005-05-06 10:43 (-0600): : > Why the %!@ would you ignore that!? :-) : : I hate my brain. Now I wonder if Bool.does(Hash). Does it? :) Any Object does Hash, and treats any argumentless method as a potential hash key. S

Re: available operator characters

2005-05-06 Thread Larry Wall
On Fri, May 06, 2005 at 01:31:43PM -0400, Rob Kinyon wrote: : > I'm sticking to non-words here, as I mentally parse not and true as : > single-arg subs, single-arg subs as unary operators, etcetera. I can't : > help it, but I have absolutely no idea how to determine the difference. : > Is it &prefi

Re: receivers of pipes (the sharp end again)

2005-05-06 Thread Larry Wall
On Fri, May 06, 2005 at 07:54:09PM +0200, Juerd wrote: : Larry Wall skribis 2005-05-06 10:37 (-0700): : > Alternately, we could make =$foo an lvalue, but ==> =$foo is a bit strange, : > and people will think it means to write to filehandle $foo. Or we could : > force people to say so

Re: receivers of pipes (the sharp end again)

2005-05-06 Thread Larry Wall
On Fri, May 06, 2005 at 01:51:58PM -0400, Rob Kinyon wrote: : I understand that the reduce [] operator will have its standard forms : ([+], [<], etc) which will be immediately recognizable just like all : the other 3-char operators (==>, etc) will be. I'm just concerned : about the extended form an

Re: Perl6 and support for Refactoring IDE's

2005-05-06 Thread Larry Wall
On Fri, May 06, 2005 at 10:26:26AM -0600, Luke Palmer wrote: : In other words, Perl 6 is open to the possibility of such an IDE, and : is going to provide the machinery necessary to build a really good : one, but I doubt it will become a development milestone. I think that, just as Perl 1 built in

Re: receivers of pipes (the sharp end again)

2005-05-06 Thread Larry Wall
On Fri, May 06, 2005 at 01:26:10PM -0400, Rob Kinyon wrote: : > : Does this mean that @{foo()} can be written as @ foo()? : > : > I would prefer not. Use foo()[] instead. : : Does this mean that some constructs in Perl are parsed immediately : (such as foo() ...) and some are deferred (such as t

Re: receivers of pipes (the sharp end again)

2005-05-06 Thread Larry Wall
On Fri, May 06, 2005 at 10:45:57AM -0600, Luke Palmer wrote: : On 5/6/05, Juerd <[EMAIL PROTECTED]> wrote: : > When piping to a scalar, I assume its reftype will determine what will : > happen. But what if the scalar is undef? Is it then assumed to want to : > behave like an array? : : If you're p

Re: receivers of pipes (the sharp end again)

2005-05-06 Thread Larry Wall
On Fri, May 06, 2005 at 06:55:47PM +0200, Juerd wrote: : Luke Palmer skribis 2005-05-06 10:45 (-0600): : > > How do you pipe to an array returned by a sub? ==> @ foo()? : > Well, you'd have to be piping into a returned array ref, because you : > can't pipe into the list the sub returns. So I think

Re: receivers of pipes (the sharp end again)

2005-05-06 Thread Larry Wall
On Fri, May 06, 2005 at 06:35:45PM +0200, Juerd wrote: : Which things can receive? : : If I recall things correctly, we already have these: : : sub # slurpy list : arrary : hash : : Would it make sense to add, for example, : : filehandle # write : : It may not, as it's n

Re: Semi-related question: reduce metaoperator

2005-05-05 Thread Larry Wall
On Thu, May 05, 2005 at 03:03:22PM -0400, Rob Kinyon wrote: : Can I put an operator in a variable and then use it in the [] : reduce meta-operator? Something like: : : $op = '+'; : $x = [$op] @x; Nope. That would be parsed as a list of one element, followed by a syntax error. You'll have to

Re: Declaration and definition of state() vars

2005-05-05 Thread Larry Wall
On Thu, May 05, 2005 at 07:50:31PM +0200, Ingo Blechschmidt wrote: : Hi, : : sub gen() { : state $svar = 42; : # Only initialized once, as it is (per S04) equivalent to : # state $svar will first{ 42 }; : return { $svar++ }; : } : : my $a = gen();# $svar == 42 : $a()

Re: stdio

2005-05-05 Thread Larry Wall
On Thu, May 05, 2005 at 10:14:34AM +0300, Gaal Yahas wrote: : On Wed, May 04, 2005 at 11:44:58PM -0700, Larry Wall wrote: : > : How do I open a file named "-"? : > : > Um, depending on what you mean, and whether we continue to support : > the '=' pseudofi

Re: reduce metaoperator

2005-05-05 Thread Larry Wall
On Wed, May 04, 2005 at 11:58:59PM -0600, Luke Palmer wrote: : On 5/4/05, Larry Wall <[EMAIL PROTECTED]> wrote: : > [<] could mean "monotonically increasing". : : Not unless we make boolean operators magic. There are arguments for : doing that, but I don't really w

Re: When scoping

2005-05-05 Thread Larry Wall
On Wed, May 04, 2005 at 11:00:46PM -0700, David Wheeler wrote: : On May 4, 2005, at 22:31 , Larry Wall wrote: : : >given "hello" { : >when /hello/ { : >say "One"; : >if /hello/ { say "Two"; } : >if /he

Re: stdio

2005-05-04 Thread Larry Wall
On Thu, May 05, 2005 at 08:39:52AM +0300, Gaal Yahas wrote: : How do I open a file named "-"? Um, depending on what you mean, and whether we continue to support the '=' pseudofile, maybe: $fh = io("-"); or $fh = open "-"; or $fh = $name eq '-' ?? $*IN :: open $name; : How do I op

Re: When scoping

2005-05-04 Thread Larry Wall
On Wed, May 04, 2005 at 11:00:31PM -0600, Luke Palmer wrote: : What should the output of this be: : : given "hello" { : when /hello/ { : say "One"; : when /hello/ { say "Two"; } : when /hello/ { say "Three"; } : continue; : } :

Re: reduce metaoperator

2005-05-04 Thread Larry Wall
On Wed, May 04, 2005 at 09:55:31PM -0600, John Williams wrote: :$sum = reduce(+) @array; # macro That one suffers the operator/term confusion I mentioned earlier. :$sum = reduce &infix:<+> @array; # regular sub That one's complicated enough that you actually installed a synta

Re: Type system questions.

2005-05-04 Thread Larry Wall
On Tue, May 03, 2005 at 09:53:59PM +0800, Autrijus Tang wrote: : On Tue, May 03, 2005 at 05:32:44AM -0700, Larry Wall wrote: : > : # Type Instantiation? : > : sub apply (&fun<::a> returns ::b, ::a $arg) returns ::b { : > : &fun($arg); : > : } : > : &

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