Re: Containers vs Objects.

2005-02-16 Thread Larry Wall
On Wed, Feb 16, 2005 at 06:35:38PM +0100, Thomas Sandla wrote: : Each of these comes with a corresponding postcicumfix dereferencer. : with .() : @ with .[] : % with . and . % with .{} (plus . and . as syntactic sugar) : Maybe now is the time to figure out what they *do* mean. : : I see

Re: Junction Values

2005-02-16 Thread Larry Wall
On Wed, Feb 16, 2005 at 01:55:31PM -0600, Patrick R. Michaud wrote: : And to : anticipate the followup question of Well, why not make features such : as junctions into optional modules?, I think a partial answer is that : features like these really need deep language support to work : effectively

Re: Fun with junctions (was Sets vs Junctions)

2005-02-16 Thread Larry Wall
On Wed, Feb 16, 2005 at 10:07:34PM -0800, chromatic wrote: : On Wed, 2005-02-16 at 08:54 -0800, David Wheeler wrote: : : And what of .c#? : : It's an alias for .java. I'm sorry, but neither of those is powerful enough to represent Perl data structures. ;-) Larry

Re: Fun with junctions (was Sets vs Junctions)

2005-02-15 Thread Larry Wall
On Sun, Feb 13, 2005 at 04:10:08PM -0600, Jonathan Scott Duff wrote: : On Sun, Feb 13, 2005 at 11:10:20AM -0600, Patrick R. Michaud wrote: : Autothreading, even if enabled by default, doesn't happen until a : junction is created and used somewhere. Thus the only time our hypothetical : new

Re: Containers vs Objects.

2005-02-15 Thread Larry Wall
On Tue, Feb 15, 2005 at 04:20:28PM -0600, Rod Adams wrote: : chromatic wrote: : : So I'm interested in hearing what pushes Arrays and Hashes over the edge : for needing their own container and sigil, whereas Junctions/Sets do not. : : : : Perl isn't a pure object-oriented language. : :

Re: Containers vs Objects.

2005-02-15 Thread Larry Wall
On Wed, Feb 16, 2005 at 01:13:53PM +1100, Damian Conway wrote: : Larry wrote: : : That's the basic problem with : : 0 $x 10 : : after all--the problem with rewriting that as : : 0 $x and $x 10 : : is that it should only work as long as the two values of $x remain : entangled so

Re: Containers vs Objects.

2005-02-15 Thread Larry Wall
On Tue, Feb 15, 2005 at 10:01:52PM -0600, Patrick R. Michaud wrote: : Uh oh, I hadn't caught that particular nuance. Is it indeed over the : entire equi-precedential part of the operation, or just over the : chained operators? Just the chained operators, I think. For more general expression

Re: Boolean literals

2005-02-15 Thread Larry Wall
On Wed, Feb 16, 2005 at 02:29:36PM +0800, Autrijus Tang wrote: : Just a quick question. The prettyprinter of Pugs (the thing that : handles the .perl method) currently prints out boolean true and : false as #t and #f, which is obviously not correct. : : pugs (1 2, 2 1) : (#f, #t) : :

Re: Fun with junctions (was Sets vs Junctions)

2005-02-15 Thread Larry Wall
On Tue, Feb 15, 2005 at 07:20:53PM -0600, Jonathan Scott Duff wrote: : For the case where a junction is stringified, I would imagine that the : Junction's Cstr or Crepr (ala python) method gets called and it does : something appropriate. The Crepr method is called C.perl in Perl, assuming you

Re: Closure trait for loop entry

2005-02-12 Thread Larry Wall
On Sat, Feb 12, 2005 at 12:44:05PM -0500, Uri Guttman wrote: : JG == Joe Gottman [EMAIL PROTECTED] writes: : : JGsub use_first() : JG{ : JG for 1..2 { : JG FIRST {say 'entering loop';} : JG say $_; : JG LAST{say

Re: Closure trait for loop entry

2005-02-12 Thread Larry Wall
On Sat, Feb 12, 2005 at 03:55:40PM -0500, Uri Guttman wrote: : LW What's going on here is that the loop body is a closure that is : LW cloned upon entry to the loop (you're logically passing a closure : LW to the for() function that implements the loop), so if there's a : LW FIRST inside,

Re: Fun with junctions (was Sets vs Junctions)

2005-02-12 Thread Larry Wall
On Sat, Feb 12, 2005 at 02:20:45PM -0600, Patrick R. Michaud wrote: : And I've yet to receive a good answer for what C3/any(0,1) does to $!. : : I'm sure that 3/any(0,1) throws some sort of divide by zero exception; : same as 3/0 would, and places the exception into $!. I don't know : that $!

Re: S04

2005-02-10 Thread Larry Wall
On Thu, Feb 10, 2005 at 07:39:54AM -0800, David Storrs wrote: : Given that Perl 6 won't support an actual do-while loop a la C++ (and : yes, I know that Perl5 didn't either), how would you accomplish that? : That is, I'd like to have a loop that runs once, then checks its : condition to see if it

Re: Perl 6 Summary for 2005-01-31 through 2004-02-8

2005-02-10 Thread Larry Wall
On Thu, Feb 10, 2005 at 12:32:21PM +0100, Miroslav Silovic wrote: : [EMAIL PROTECTED] wrote: : : i think so but i can't read larry's mind (nor would i want to! :) : : XP = extreme programming : DBC = design by contract (or even designed by conway :) : MP = ?? : : : Modular

= vs == [was: Perl 6 Summary for 2005-01-31 through 2004-02-8]

2005-02-09 Thread Larry Wall
On Wed, Feb 09, 2005 at 10:04:48AM +0100, Michele Dondi wrote: : On Tue, 8 Feb 2005, Matt Fowles wrote: : : pipe dreams :Juerd wondered if he could mix = and == in a sane way. The answer :appears to be no. Once you bring in == you should stick with it. : : Huh?!? It doesn't seem to me

Re: Perl 6 Summary for 2005-01-31 through 2004-02-8

2005-02-09 Thread Larry Wall
On Wed, Feb 09, 2005 at 11:57:17AM -0800, Ovid wrote: : --- Matt Fowles [EMAIL PROTECTED] wrote: : : Logic Programming in Perl 6 : Ovid asked what logic programming in perl 6 would look like. No : answer : yet, but I suppose I can pick the low hanging fruit: as a : limiting case :

Re: Reality check

2005-02-07 Thread Larry Wall
On Fri, Feb 04, 2005 at 10:39:30PM +0100, Juerd wrote: : Does this make sense? : : my @words = gather { : for =(open '/usr/share/dict/words' err die) { : .=chomp; : next if /-[a-z]/; : /$re/ and take { word = $_, score = %scores{ .letters }.sum }; :

Re: Junctive puzzles.

2005-02-07 Thread Larry Wall
On Tue, Feb 08, 2005 at 11:12:40AM +0800, Autrijus Tang wrote: : This way, both associativity and junctive dimensionality holds, so : I think it's the way to go. Please correct me if you see serious : flaws with this approach. Feels right to me. Larry

Re: Some quick questions.

2005-02-05 Thread Larry Wall
On Sat, Feb 05, 2005 at 02:08:32PM +0800, Autrijus Tang wrote: : On Sat, Feb 05, 2005 at 04:44:41AM +0800, Autrijus Tang wrote: : * What is the value of a reference in any of the scalar contexts? : : Currently I'm blindly dereferencing it. : : It seems that I got four out of five correct;

Re: Semicolons as list separators.

2005-02-05 Thread Larry Wall
On Sat, Feb 05, 2005 at 04:30:58PM +0800, Autrijus Tang wrote: : So it turns out that A03 says that semicolons within brackets defaults : to a list-of-list builder. Curiously, it is missing from S03, and the : behaviour is not documented in detail. That's because it's still a bit hand-wavey. :

Re: S04

2005-01-29 Thread Larry Wall
On Sat, Jan 29, 2005 at 05:59:40PM +0100, Juerd wrote: : Some questions after reading S04: : : : Can last/redo be used outside loops? (i.e. with if or given) No, though of course what loop means is negotiable. Effectively, anything that captures the appropriate control exceptions is a loop.

Re: E, Perl 6, etc.

2005-01-19 Thread Larry Wall
On Tue, Jan 18, 2005 at 10:08:57PM -0800, Rich Morin wrote: : I recently encountered a language, E, which has some very nifty : features for building distributed systems. The current version : of E is built on top of Java, but I wonder: : : * whether E's features will (could) be supported in

Re: Dimension of slices; scalars versus 1-element arrays?

2005-01-10 Thread Larry Wall
On Sat, Jan 08, 2005 at 11:37:06AM -0700, Craig DeForest wrote: : I just re-read Synopsis 9, which covers PDL-related actions and array slicing, : and came to the conclusion that either (A) there's a hole in the syntax as it : is lain out, (B) I lack sufficient understanding of what has been

Re: thoughts about types, and possible syntax for code as comment

2005-01-07 Thread Larry Wall
On Thu, Jan 06, 2005 at 11:07:47PM +0100, Stéphane Payrard wrote: : To get an huffmanized name and a clear one, I would like some support syntax: : : sub canon( $subjet as $s , $complement as $c ) { : # code with lots of $s and $s : } Aliasing can currently be done with the binding

Re: strictness and fully qualified global vars

2005-01-04 Thread Larry Wall
On Tue, Dec 28, 2004 at 10:31:37PM -0800, Ashley Winters wrote: : On Tue, 28 Dec 2004 22:31:47 -0700, Luke Palmer [EMAIL PROTECTED] wrote: : Ashley Winters writes: : sub foo (Class $who) { : my $thing := $who$var; : my func := $whofunc; # how would I do this otherwise? : } : :

Re: Auto My?

2004-12-20 Thread Larry Wall
On Sun, Dec 19, 2004 at 08:25:58PM -0600, Rod Adams wrote: : Another facet of this discussion comes into account when also specifying : type. : : from S9: : my bit @bits; : my int @ints; : my num @nums; : my int4 @nybbles; : my str @buffers; : my ref[Array] @ragged2d; : my complex128

Hyphenated rule names [Was: Perl 6 Summary for 2004-12-06 through 2004-12-20]

2004-12-20 Thread Larry Wall
On Mon, Dec 20, 2004 at 09:52:32PM -0500, Matt Fowles wrote: : Much churning went on and it seems that multiple different : (but identically named) rule captures can now be performed by adding : information after a dash ala ws-1 ws-2 ws-3. Actually, much churning is still going on in

Re: Classes with several, mostly unused, attributes

2004-12-16 Thread Larry Wall
On Thu, Dec 16, 2004 at 10:42:35AM +0100, Michele Dondi wrote: : On Wed, 15 Dec 2004, Abhijit Mahabal wrote: : : #!/usr/bin/perl -e : $x = 1; : : Is this supposed to work? I would tend to consider it counter intuitive... It occurred to me as I was dropping off to sleep last night that it can't

Re: Classes with several, mostly unused, attributes

2004-12-16 Thread Larry Wall
On Fri, Dec 10, 2004 at 11:05:32AM -0500, Abhijit Mahabal wrote: : Consider a class (e.g., the hypothetical Geometry::Triangle) that can : have several attributes (side1, side2, side3, angle1, ang_bisector1, : side_bisector, altitude1 and so forth), most of which will not be : needed for most

Re: S05 question

2004-12-09 Thread Larry Wall
On Wed, Dec 08, 2004 at 08:24:20PM -0800, Ashley Winters wrote: : I'm still going to prefer using :=, simply as a good programming : practice. My mind sees a big difference between building a parse-tree : object and just grepping for some word I want in a string. Within a : rule{} block, there is

Re: S05 question

2004-12-08 Thread Larry Wall
On Tue, Dec 07, 2004 at 10:36:53PM -0800, Larry Wall wrote: : But somehow I expect that when someone writes (foo) they probably : usually meant («foo»). If we're going to stick with the notion that foo captures and something else doesn't, I'm beginning to think that the other thing isn't «foo

Re: Is object representation per class or per object?

2004-12-08 Thread Larry Wall
On Tue, Dec 07, 2004 at 12:32:50PM -0500, Abhijit Mahabal wrote: : According to S12, it is possible to supply the object layout to bless(), : like so: : : $object = $class.bless(:CREATE[:reprP6opaque] :k1($v1) :k2($v2)) : : But in the section Introspection, layout is a class trait. Does this :

Re: S05 question

2004-12-08 Thread Larry Wall
On Wed, Dec 08, 2004 at 11:09:30AM -0700, Patrick R. Michaud wrote: : On Wed, Dec 08, 2004 at 08:19:17AM -0800, Larry Wall wrote: : And people would have to get used to seeing ? as non-capturing assertions: : ?before ... : ?after ... : ?ws : ?sp : ?null : This has

Re: S05 question

2004-12-07 Thread Larry Wall
On Tue, Dec 07, 2004 at 12:11:18PM -0700, Patrick R. Michaud wrote: : I'm reviewing the updated S05 (2 Dec 2004) and ran across this : in the Hypothetical Variables section: : : # Pairs of repeated captures can be bound to hashes: : : / %options := [ (ident) = (\N+) ]* / : :

Re: specifying the key Type for a Hash

2004-12-06 Thread Larry Wall
On Mon, Dec 06, 2004 at 05:43:16AM +, Nigel Sandever wrote: : I probably missed teh comprehensive dismissal thread, but why not 'type'? : : my %pet is Hash[:type(Str) :returns(Cat)]; Well, type is just a little off in a couple of ways. On the one hand, it's not specific enough,

Re: Arglist I/O [Was: Angle quotes and pointy brackets]

2004-12-06 Thread Larry Wall
On Mon, Dec 06, 2004 at 09:06:22AM -0800, David Wheeler wrote: : On Dec 6, 2004, at 7:38 AM, Austin Hastings wrote: : :for = {...} : : I dub the...the fish operator! : : :-) Mmm. Next thing you'll know, people will name their files oddly just so they can write things like: for =///º

Topification [Was: Arglist I/O [Was: Angle quotes and pointy brackets]]

2004-12-06 Thread Larry Wall
On Mon, Dec 06, 2004 at 10:38:10AM -0500, Austin Hastings wrote: : Two more issues: idiom, and topification : : = Topification: : : There are cases in P5 when I *don't* want : : while () {...} : : but prefer : : while ($input = ) {...} : : so that I can have something else be the

while idiom [Was: Arglist I/O [Was: Angle quotes and pointy brackets]]

2004-12-06 Thread Larry Wall
On Mon, Dec 06, 2004 at 10:38:10AM -0500, Austin Hastings wrote: : = Idiom: : : The other concern is idiom. Using Cfor suggests start at the : beginning, continue to the end. OTOH, using Cwhile is a little : weaker -- keep doing this until it's time to stop. Obviously they'll : usually be

Re: Arglist I/O [Was: Angle quotes and pointy brackets]

2004-12-06 Thread Larry Wall
Or even the dead fish operator: while =###x - $net {...} And here's a flounder: while =: Larry

Re: pull put (Was: Angle quotes and pointy brackets)

2004-12-06 Thread Larry Wall
On Mon, Dec 06, 2004 at 10:45:22AM -0500, Austin Hastings wrote: : But I'd be willing to rename them to get/put. If I went with get, the opposite would be unget for both historical and huffmaniacal reasons. Larry

Re: while idiom [Was: Arglist I/O [Was: Angle quotes and pointy brackets]]

2004-12-06 Thread Larry Wall
On Mon, Dec 06, 2004 at 12:45:18PM -0600, Jonathan Scott Duff wrote: : On Mon, Dec 06, 2004 at 09:56:57AM -0800, Larry Wall wrote: : On Mon, Dec 06, 2004 at 10:38:10AM -0500, Austin Hastings wrote: : : Can we ditch Cfor in the examples in favor of Cwhile, for a while? :) : : Okay. Have

Re: pull put (Was: Angle quotes and pointy brackets)

2004-12-06 Thread Larry Wall
On Mon, Dec 06, 2004 at 11:52:22AM -0700, Dan Brian wrote: : If I went with get, the opposite would be unget for both historical : and huffmaniacal reasons. : : But get has too strong a class accessor connotation in most OO. : : unpull? ;-) Given the existence of a unary = for abbreviated use,

Re: specifying the key Type for a Hash

2004-12-06 Thread Larry Wall
On Mon, Dec 06, 2004 at 03:11:15AM -0700, David Green wrote: [snip] : I like that. [snip] : I like that even better. [snip] : I'm happy with those too (perhaps because I do want to be a bit : mathematical). [snip] : is FAT? Yeah, that works for me too. =) [snip] : I would take that as an

Re: Container method calls

2004-12-06 Thread Larry Wall
On Sat, Dec 04, 2004 at 03:28:12PM -0800, Ashley Winters wrote: : On Sat, 4 Dec 2004 11:15:14 -0800, Larry Wall [EMAIL PROTECTED] wrote: : On Sat, Dec 04, 2004 at 10:25:49AM -0700, Luke Palmer wrote: : : But this convention provides much more accuracy than memorizing a list : : of methods

Re: iterators and functions (and lists)

2004-12-06 Thread Larry Wall
On Sun, Dec 05, 2004 at 12:05:46AM +, Matthew Walton wrote: : I'm sorry, but from a C++ background, overriding postcircumfix:( ) : feels far more natural to me than setting 'is default' on some method. That only works for disambiguation if you know which .() to call in the first place. It

Re: slight discrepancy between S2 and S7

2004-12-06 Thread Larry Wall
On Mon, Dec 06, 2004 at 08:26:48PM +0100, Stéphane Payrard wrote: : S2: : : my $foo = 42; : say %MY::$foo;# prints 42 : : S6: : : Perl5ish subroutine declarations : ... : sub say { print qq{@_\n}; } # args appear in @_ : : : Because Cprint has no final

Re: pull put (Was: Angle quotes and pointy brackets)

2004-12-06 Thread Larry Wall
On Mon, Dec 06, 2004 at 03:50:42PM -0500, Austin Hastings wrote: : Larry Wall wrote: : : On Mon, Dec 06, 2004 at 11:52:22AM -0700, Dan Brian wrote: : : If I went with get, the opposite would be unget for both historical : : and huffmaniacal reasons. : : : Why? (I get the huffman

Re: iterators and functions (and lists)

2004-12-06 Thread Larry Wall
On Mon, Dec 06, 2004 at 06:14:56PM -0500, Austin Hastings wrote: (B: Luke Palmer wrote: (B: (B: Larry Wall writes: (B: (B: (B: Any foo() can return a list. That list can be a Lazy list. So the (B: ordinary return can say: (B: (B:return 0...; (B: (B: to return an infinite

Re: state vs my

2004-12-04 Thread Larry Wall
On Fri, Dec 03, 2004 at 11:36:02PM -0800, Brent 'Dax' Royal-Gordon wrote: : Larry Wall [EMAIL PROTECTED] wrote: : So optimizing to a state variable won't necessarily help your loop : overhead, but it could help your subroutine overhead, at least in Perl : 5, if Perl 5 had state variables. Best

Re: Arglist I/O [Was: Angle quotes and pointy brackets]

2004-12-04 Thread Larry Wall
Okay, maybe I should have gone to bed, but I kept thinking about this. I'm starting to suspect it's time to haul out the operator I've been holding in reserve for lo these many years now, the unary =. Suppose we say that it iterates iterators, but also it recognizes certain things that aren't

Re: Arglist I/O [Was: Angle quotes and pointy brackets]

2004-12-04 Thread Larry Wall
On Fri, Dec 03, 2004 at 06:38:42PM -0800, Larry Wall wrote: : Might even just be a global multi sub that defaults to $*ARGS: : : multi sub *lines (IO ?$handle = $*ARGS) {...} : multi sub *lines (Str $filename) {...} : multi sub *lines (IO @handle) {...} : multi sub *lines (Str

Re: state vs my

2004-12-04 Thread Larry Wall
On Sat, Dec 04, 2004 at 08:03:45PM +0300, Alexey Trofimenko wrote: : P.S. : btw, what about : : my @rray; : # i'm starting to like that sigil is a part of name idea :) Too cute. But what about %ash and unction? Or is it ubroutine? losure? : for 1..10 { : { :push @rray, \(

Re: Container method calls

2004-12-04 Thread Larry Wall
On Sat, Dec 04, 2004 at 10:25:49AM -0700, Luke Palmer wrote: : Ashley Winters writes: : For several reasons, that doesn't work for me. The method conflict : between container methods and value methods should be obvious. What : should ((1|2)|(34)).values return? : : Well, there is an answer,

Re: iterators and functions (and lists)

2004-12-04 Thread Larry Wall
On Sat, Dec 04, 2004 at 08:03:53PM +0300, Alexey Trofimenko wrote: : hm.. consider that: : : perl5: :open $fh, 'file'; :$first_line = $fh; :@remaining = $fh; : : perl6: :$fh = open 'file'; :$first_line = $fh(); :@remaining = $fh(); : : I thought about parallels between

Re: specifying the key Type for a Hash

2004-12-04 Thread Larry Wall
On Sat, Dec 04, 2004 at 08:01:46AM -0700, David Green wrote: : In article [EMAIL PROTECTED], : [EMAIL PROTECTED] (Larry Wall) wrote: : S9 talk about it. We current have things like: : my Cat %pet is shape(Str); : and parameters to types are in square brackets, so it's more like: : my

Re: Arglist I/O [Was: Angle quotes and pointy brackets]

2004-12-04 Thread Larry Wall
On Sat, Dec 04, 2004 at 01:24:41PM -0800, Larry Wall wrote: : I suppose we could also have : : for words {...} : for tokens {...} : for paragraphs {...} : for chunks(, :delim(/^^===+\h*\n/)) {...} : : etc. I see a problem with for words {...} since there's likely

Re: state vs my

2004-12-04 Thread Larry Wall
On Sun, Dec 05, 2004 at 02:15:51AM +0300, Alexey Trofimenko wrote: : I thought, its primary use is for closures: : : sub test { : my $a=10; : return sub { $a++ } : } : : vs : sub test { : return sub {state $a=10; $a++ } : } : : $func1 = test; : $func2 = test; : : would

Re: Angle quotes and pointy brackets

2004-12-03 Thread Larry Wall
On Thu, Dec 02, 2004 at 09:15:50PM -0800, Larry Wall wrote: : On Thu, Dec 02, 2004 at 02:54:42PM -0700, John Williams wrote: : : Does / -alpha / capture to $0{'-alpha'} ? : : Or should that be written / -«alpha» / ? : : At the moment I've got it that only assertions of the form word capture

Re: Angle quotes and pointy brackets

2004-12-03 Thread Larry Wall
On Fri, Dec 03, 2004 at 12:56:18AM -0800, Brent 'Dax' Royal-Gordon wrote: : Larry Wall [EMAIL PROTECTED] wrote: : Speaking of at the moment, I just now updated the Synopses at : dev.perl.org. : : The new S2 says: : # Heredocs are no longer written with , but with an adverb on any other

Arglist I/O [Was: Angle quotes and pointy brackets]

2004-12-03 Thread Larry Wall
On Fri, Dec 03, 2004 at 09:31:33AM -0800, Larry Wall wrote: : I guess the only real argument against unifying is that neither of : : for [EMAIL PROTECTED] {...} : : or : : for @foo {...} : : indicate destructive readout. Which probably says that * : is the wrong operator to use

Re: specifying the key Type for a Hash

2004-12-03 Thread Larry Wall
On Fri, Dec 03, 2004 at 05:23:56PM -0500, Abhijit Mahabal wrote: : A6 included examples of syntax for specifying the type of the key for a : hash: : : my %pet is Hash(keytype = Str, returns = Cat) : : None of the synopses have anything like this. S6 talks about the : types of values, but not

Re: Python is not Java...but will Perl 6 be?

2004-12-03 Thread Larry Wall
On Fri, Dec 03, 2004 at 04:13:01PM -0500, John Siracusa wrote: : On Fri, 3 Dec 2004 22:06:43 +0100, Paul Johnson [EMAIL PROTECTED] wrote: : http://www.nntp.perl.org/group/perl.perl6.language/9576 : : Wow, that's a blast from the past. I wonder how much of it is still : valid... :) Almost all

Re: flip flop xx Inf

2004-12-03 Thread Larry Wall
On Sat, Dec 04, 2004 at 01:11:30AM +0100, Juerd wrote: : What happens to the flip flop operator? Will .. in scalar context remain : the same? I don't think so. It's definitely a candidate for a longer Huffmanization simply in terms of frequency of use. On top of which, almost no Perl 5

Re: Arglist I/O [Was: Angle quotes and pointy brackets]

2004-12-03 Thread Larry Wall
On Fri, Dec 03, 2004 at 06:43:05PM +, Herbert Snorrason wrote: : This whole issue kind of makes me go 'ugh'. One of the things I like : best about Perl is the amazing simplicity of the input construct. Hmm. while () {...} for .lines {...} Looks like a wash to me. : Replacing that

Re: flip flop xx Inf

2004-12-03 Thread Larry Wall
On Fri, Dec 03, 2004 at 05:37:54PM -0700, Luke Palmer wrote: : Juerd writes: : What happens to the flip flop operator? Will .. in scalar context : remain the same? What comes in place of ...? (An adverb?) : : The scalar range operator was always a weird one for me, but that isn't : to say that

Re: state vs my

2004-12-03 Thread Larry Wall
On Sat, Dec 04, 2004 at 06:31:35AM +0300, Alexey Trofimenko wrote: : : for 1..10_000_000 { : my ($a,$b,$c) = ... : ... : } : : vs. : : for 1..10_000_000 { : state ($a,$b,$c) = ... : ... : } : : latter looks like it would run faster, because no reallocation envolved

Re: Angle quotes and pointy brackets

2004-12-02 Thread Larry Wall
On Thu, Dec 02, 2004 at 02:54:42PM -0700, John Williams wrote: : Does / -alpha / capture to $0{'-alpha'} ? : Or should that be written / -«alpha» / ? At the moment I've got it that only assertions of the form word capture. Anything else you have to do an explicit binding, or use :keepall. Larry

Re: qq:i

2004-12-01 Thread Larry Wall
On Wed, Dec 01, 2004 at 11:41:37AM -0500, Matt Diephouse wrote: : So... maybe we can pass a parameter saying what we want to use to interpolate? : : my $name = 'add'; : my $code = q:c«[ : sub «$name» ($left, $right) { : return $left + $right; :} : ]; : # prints :

Re: Angle quotes and pointy brackets

2004-12-01 Thread Larry Wall
On Wed, Dec 01, 2004 at 09:55:32AM +, Matthew Walton wrote: : I neglected to mention that the smart quoter should also recognize : pair notation and handle it. : : I've been trying to get my brain round that, but I can't quite figure : out what you mean. Pair notation is, as I understand it,

Re: Hyper Here-Docs?

2004-11-30 Thread Larry Wall
On Wed, Dec 01, 2004 at 06:16:03AM +1100, Damian Conway wrote: : If you wanted to get a function for each element in an array @a, I : suppose you can say: : : sub makefunc($x){{$x}} : @funcarray = @a.makefunc; : : You're attempting to call a sub as a method. You want: : : @funcarray =

Re: Angle quotes and pointy brackets

2004-11-30 Thread Larry Wall
On Tue, Nov 30, 2004 at 03:17:42AM +0300, Alexey Trofimenko wrote: : Why to introduce (or REintroduce) something if we have something : similar already? : : $captured = system :capture q/cmd../; By the way, that one happens to be illegal at the moment. To use pairs as part of an argument

Re: Angle quotes and pointy brackets

2004-11-30 Thread Larry Wall
On Tue, Nov 30, 2004 at 09:09:39AM +0300, Alexey Trofimenko wrote: : When I look at this :$varkey1key2[3]key3 : : then I think that it's a *very* cute, nice, and clean syntax... I really : like it! : (and I would sacrifice something for that to happen, if I would be Larry : :) ) : but

Re: $ @ and %

2004-11-30 Thread Larry Wall
On Tue, Nov 30, 2004 at 04:41:00AM +0300, Alexey Trofimenko wrote: : P.P.P.S. If answer on my why? would be just because! I would take it : silently. : : yes, answer was as I predicted above. I promised.. You have a funny idea of what silently means. :-) : ..but: : As far as I understood,

Re: Angle quotes and pointy brackets

2004-11-30 Thread Larry Wall
On Tue, Nov 30, 2004 at 10:05:03PM +, Matthew Walton wrote: : So : : my @list = foo bar baz; : : is the equivalent of : : my @list = ('foo', 'bar', 'baz'); : : ? Yes. : * Since we already stole angles from iterators, «$fh» is not : how you make iterators iterate. Instead we use

Re: Angle quotes and pointy brackets

2004-11-30 Thread Larry Wall
On Tue, Nov 30, 2004 at 02:40:01PM -0800, David Wheeler wrote: : On Nov 30, 2004, at 2:23 PM, Larry Wall wrote: : : Correct. The p5-to-p6 translator will turn any : : while (handle) {...} : : into : : for @$handle {...} : : I assume that each value would be still fetched from

Re: Angle quotes and pointy brackets

2004-11-30 Thread Larry Wall
On Tue, Nov 30, 2004 at 02:26:06PM -0800, Brent 'Dax' Royal-Gordon wrote: : I like this in general. However... : : Larry Wall [EMAIL PROTECTED] wrote: : * Since we already stole angles from iterators, $fh is not : how you make iterators iterate. Instead we use $fh.fetch

Re: Angle quotes and pointy brackets

2004-11-30 Thread Larry Wall
On Tue, Nov 30, 2004 at 05:39:29PM -0700, Luke Palmer wrote: : I don't know what argumentless shift does now. It probably works on : @*ARGS when you're in the main program, but inside a sub... I dunno. : Maybe it shifts from the slurpy array argument. Shifting on the topic : seems wrong (since

Re: Angle quotes and pointy brackets

2004-11-30 Thread Larry Wall
On Tue, Nov 30, 2004 at 06:27:55PM -0500, Matt Fowles wrote: : Even if he wasn't cackling, I admit to feeling it. I don't even use : the qx/qq/qw stuff in perl5. I always got by with . : : Although I must admit to liking python's C r... meaning : absolutely raw string (useful for avoiding

Re: Angle quotes and pointy brackets

2004-11-30 Thread Larry Wall
On Tue, Nov 30, 2004 at 03:03:38PM -0800, Jon Ericson wrote: : Larry Wall [EMAIL PROTECTED] writes: : : The p5-to-p6 translator will turn any : : while (handle) {...} : : into : : for @$handle {...} : : Including: : : while() {...} : : to : : for @$ {...} : : ? You left

Re: Angle quotes and pointy brackets

2004-11-27 Thread Larry Wall
On Fri, Nov 26, 2004 at 02:10:06PM -0800, Larry Wall wrote: : I might be happy to remove them, though people will write q:x instead : of qq:x and wonder why it doesn't interpolate. What I think is fun is : qq:x:w, which presumably runs the command and then splits the result : into words. : : I

Re: $ @ and %

2004-11-26 Thread Larry Wall
On Fri, Nov 26, 2004 at 10:29:52AM +0300, Alexey Trofimenko wrote: : I'm talking about unifying namespaces of arrays, hashes and scalars. I : could swear i've seen some RFC about it.. Yes that's RFC 9, which was discussed and rejected long ago in A2. I just find that I prefer to think of the

Re: Angle quotes and pointy brackets

2004-11-26 Thread Larry Wall
On Fri, Nov 26, 2004 at 07:32:58AM +0300, Alexey Trofimenko wrote: : ah, I forget, how could I do qx'echo $VAR' in Perl6? something like : qx:noparse 'echo $VAR' ? Hmm, well, with the currently defined adverbs you'd have to say qx:s(0)'echo $VAR' but that doesn't give you protection from

Re: Angle quotes and pointy brackets

2004-11-26 Thread Larry Wall
On Fri, Nov 26, 2004 at 07:31:09PM +0100, Juerd wrote: : Larry Wall skribis 2004-11-26 9:33 (-0800): : but that doesn't give you protection from other kinds of interpolation. : I think we need two more adverbs that add the special features of qx and qw, : so that you could write that: q:x/echo

Re: angle quotes for here-docs ?

2004-11-25 Thread Larry Wall
On Thu, Nov 25, 2004 at 05:03:36PM +0100, Juerd wrote: : Thomas Seiler skribis 2004-11-25 14:52 (+0100): : Is $heredoc = «END; the same as $heredoc = END; ? : : I certainly hope not. : : Quoting the delimiter is needed, by the way. : : How is 'END' disambiguated from 'qw' list, anyway? To get

Re: Will _anything_ be able to truly parse and understand perl?

2004-11-25 Thread Larry Wall
On Thu, Nov 25, 2004 at 02:31:46PM +1100, Adam Kennedy wrote: : Let's say you want to write a yacc grammar to parse Perl 6, or : Parse::RecDescent, or whatever you're going to use. Yes, that will be : hard in Perl 6. Certainly harder than it was in Perl 5. : : In the end, I concluded there was

Re: Hyper Here-Docs? (was: Re: angle quotes for here-docs ?)

2004-11-25 Thread Larry Wall
On Thu, Nov 25, 2004 at 11:59:21AM -0600, Rod Adams wrote: : Seeing the « in the context of a here-doc made me think can you do a : » here-doc? Nope, you can only hyper operators, not terms. : So, something like : : : @text = »END; : text1 : END : : text2 : END : : text3 : END : : text4 :

Re: Angle quotes and pointy brackets

2004-11-25 Thread Larry Wall
On Thu, Nov 25, 2004 at 11:12:32PM +0100, Juerd wrote: : But if mixed « is allowed, isn't that «»syntax error? Or did I : misinterpret the answer re mixing them? Uh, I wasn't aware that I'd actually answered the question. :-) My actual inclination is to disallow it. I was just trying to argue

Re: angle quotes for here-docs ?

2004-11-25 Thread Larry Wall
On Thu, Nov 25, 2004 at 09:37:21PM +0100, Juerd wrote: : Larry Wall skribis 2004-11-25 9:39 (-0800): : : How is 'END' disambiguated from 'qw' list, anyway? : To get the qw// parse you must put a space between the and the : quote. This is no hardship semantically, since qw// has always thrown

Re: S13: Deep operators

2004-11-23 Thread Larry Wall
On Mon, Nov 22, 2004 at 07:51:29PM +, Matthew Walton wrote: : And can I overload based on return types? In the case of an MMD tie, the default routine could use the return type context to break the tie. That's about the limit of what's practical, I suspect. Possibly we could give some

Re: return value of s///

2004-11-19 Thread Larry Wall
On Fri, Nov 19, 2004 at 10:20:23PM +, Nicholas Clark wrote: : In perl 6 will these always return a match object? Or will it be as perl 5 : and return the number of substitutions (or the empty string if none) Yes, and yes. The match object returns the number of substitutions in a numeric

Re: S10/11 Questions

2004-11-10 Thread Larry Wall
On Wed, Nov 10, 2004 at 01:12:46PM -0600, Rod Adams wrote: : Larry Wall wrote: : : On Tue, Nov 09, 2004 at 09:18:47PM -0600, Rod Adams wrote: : : Can we get an AUTOCLASS/AUTOCLASSDEF hook pair? : : Considering a class is just a variable in another symbol table, seems : like an AUTOVAR

Re: S11 - Modules and export

2004-11-09 Thread Larry Wall
On Tue, Nov 09, 2004 at 05:20:50PM -0500, Aaron Sherman wrote: : I'm still troubled by the export trait as I read S11. I like not having : to write a new subroutine in a procedural module and THEN go back up and : edit @EXPORT. That's good. : : But, it seems to me that: : : module MyHTML {

Re: S10/11 Questions

2004-11-09 Thread Larry Wall
On Tue, Nov 09, 2004 at 09:18:47PM -0600, Rod Adams wrote: : Can we get an AUTOCLASS/AUTOCLASSDEF hook pair? Considering a class is just a variable in another symbol table, seems like an AUTOVAR in the container might cover it. : How does one create a class with a hyphen in the middle of it?

Re: anonimity

2004-11-07 Thread Larry Wall
On Sun, Nov 07, 2004 at 06:19:05PM -0600, Jonathan Scott Duff wrote: : It eliminates the hackish division of circumfix operators by making : each side explicit. This is an improvement if you ask me. More importantly, it avoids having to enumerate a list of characters that have to be backslashed.

Re: Suggested warning

2004-11-07 Thread Larry Wall
On Sun, Nov 07, 2004 at 12:40:45PM -0500, Aaron Sherman wrote: : I would like to suggest that we define: : : multi sub *infix:+(...) {...} : : Will always generate a warning (not just for Cinfix:+, but for any : operator) if used outside of a class definition or if used inside a : class

Re: anonimity

2004-11-06 Thread Larry Wall
On Sat, Nov 06, 2004 at 09:17:03PM +0100, Juerd wrote: : Which things can either have a name or be anonymous? : : Scalar values : Arrays : Hashes : Rules : Subs : Classes? : Roles? : Modules? : Other things? Subtypes Enums Lists (Lazy and Eager) Grammars Packages : If anonymous roles exist,

Re: anonimity

2004-11-06 Thread Larry Wall
By the way, until I figure out how to drive combust on perl.org, the most recent versions of Apocalpses and Synopses may be found at http://www.wall.org:~larry/apo http://www.wall.org:~larry/syn There are new S10, S11, S12, and S13 pods there. Recent changes include: Strictures and

Re: anonimity

2004-11-06 Thread Larry Wall
On Sat, Nov 06, 2004 at 10:37:39PM +0100, Juerd wrote: : Larry Wall skribis 2004-11-06 13:32 (-0800): : On Sat, Nov 06, 2004 at 09:17:03PM +0100, Juerd wrote: : : Which things can either have a name or be anonymous? : (...) : Lists (Lazy and Eager) : : If lists can be named

Re: anonimity

2004-11-06 Thread Larry Wall
On Sat, Nov 06, 2004 at 02:00:28PM -0800, Larry Wall wrote: : By the way, until I figure out how to drive combust on perl.org, : the most recent versions of Apocalpses and Synopses may be found at : : http://www.wall.org:~larry/apo : http://www.wall.org:~larry/syn Er, s:2nd

Re: Regular expressions and closures (was: Perl 6 Summary for 2004-10-01 through 2004-10-17)

2004-10-26 Thread Larry Wall
On Tue, Oct 26, 2004 at 01:42:02PM -0400, Aaron Sherman wrote: : Larry, while you're feeling chatty, I have a question about Perl 6 : regular expressions for you. You answered a question of mine, long ago : with a correction. I had said something like: : : /ab(c|b){$1 eq 'c'}/ : : If I

<    10   11   12   13   14   15   16   17   18   19   >