Re: The old $x will not stay shared thing.

2006-01-16 Thread Larry Wall
On Mon, Jan 16, 2006 at 02:38:14PM +0800, Audrey Tang wrote: : -BEGIN PGP SIGNED MESSAGE- : Hash: SHA1 : : I'm almost sure this had been covered before, but I failed to find a : reference in either the archives or in synopses, so here goes again: : : sub f ($x) { : sub g ($y)

Re: Pattern matching on arrays and for loops

2006-01-13 Thread Larry Wall
On Fri, Jan 13, 2006 at 11:42:13PM +, Luke Palmer wrote: : On 1/13/06, Dave Whipp [EMAIL PROTECTED] wrote: : What happens if I simply abandon the attempt at anonymous MMD and use a : named multi-sub, instead: : : { : my multi sub process_arg(-f, Str $f is rw) { :$f .=

Re: Array Holes

2006-01-13 Thread Larry Wall
On Fri, Jan 13, 2006 at 10:33:23PM +, Luke Palmer wrote: : In perl 5: : : my @a = (1,2,3); : delete $a[1]; : print exists $a[1]; : : This is false, whereas $a[0] and $a[2] do exist. This is creepy. Not : only is it creepy, it raises a whole bunch of questions with : nontrivial

Re: Table of Perl 6 Types

2006-01-12 Thread Larry Wall
On Thu, Jan 12, 2006 at 08:29:29PM +, Luke Palmer wrote: : The only remaining problem is that we have no syntax for ...3, which : doesn't make sense as a list, but does make sense as a range. Well, it could be a lazy list that you only ever pop, I suppose. In any event, it doesn't work

Re: Array/list transformations.

2005-12-27 Thread Larry Wall
On Tue, Dec 27, 2005 at 01:13:10PM -0500, Rob Kinyon wrote: : On 12/27/05, Larry Wall [EMAIL PROTECTED] wrote: : On Tue, Dec 27, 2005 at 12:10:45AM -0500, Rob Kinyon wrote: : : Creating an array whose positions are aliases for positions in another : : array can be useful. How about

Re: Array/list transformations.

2005-12-26 Thread Larry Wall
On Tue, Dec 27, 2005 at 12:10:45AM -0500, Rob Kinyon wrote: : Creating an array whose positions are aliases for positions in another : array can be useful. How about : : my @s := @a[0,2,4] is alias; : : @a[2] = 3; # @s[1] == 3 : @s[1] = 4; # @a[2] == 4 : : The default slicing

Re: Multiple implementations of Perl 6

2005-12-24 Thread Larry Wall
On Sat, Dec 24, 2005 at 11:25:43PM +1100, Andrew Savige wrote: : Apologies if I'm Mr Magoo, but I did a bit of a search on this just now, and : uncovered little more than a pithy quote from Piers Cawley in: : : http://dev.perl.org/perl6/list-summaries/2005/p6summary.2005-07-05.html : : asserting

Re: Problem with dwimmery

2005-12-23 Thread Larry Wall
On Thu, Dec 22, 2005 at 03:19:03PM -0800, Jonathan Lang wrote: : As a third possibility, could we huffman-code do nothing clauses by : leaving out the appropriate argument? That is: : : while $x-- some_condition($x); : : or : : loop ( ; some_condition($x) ; $x--); We could, except that

Re: Deep copy

2005-12-23 Thread Larry Wall
I think that deep copying is rare enough in practice that it should be dehuffmanized to .deepcopy, perhaps with optional arguments saying how deep. Simple shallow copy is .copy, whereas .clone is a .bless variant that will copy based on the deep/shallow preferences of the item being cloned. The

Re: handling undef better

2005-12-17 Thread Larry Wall
On Sat, Dec 17, 2005 at 12:12:15PM -0800, Ashley Winters wrote: : Explicitly nil values wouldn't warn or fail on activities which undef : does. nil is basically a value which is simultaneously '' and 0 and : 0.0 and false *and* defined, and allows itself to be coerced with the : same rules as

Re: Transliteration preferring longest match

2005-12-16 Thread Larry Wall
On Fri, Dec 16, 2005 at 01:29:11PM +0100, Ruud H.G. van Tol wrote: : John Macdonald: : : [trans] : If a shorter rule is allowed to match first, then the longer : rule can be removed from the match set, at least for constant : string matches. : : It is not about the length of the rules, but

Re: Transliteration preferring longest match

2005-12-16 Thread Larry Wall
On Fri, Dec 16, 2005 at 09:14:52AM -0800, Larry Wall wrote: : It would be a useful exercise to write tr/// in terms of s///. : It occurs to me that it'd be awfully useful to have a kind of hash : that returns any unmatched key unchanged. Actually, in this case it's handled by the fact

Re: import/export and module configuration

2005-12-16 Thread Larry Wall
On Tue, Dec 13, 2005 at 12:42:47PM +0200, Gaal Yahas wrote: : S11 stipulates: : : * modules can decorate exports with tagsets : : * module users are the ones who control which imports are allowed, : and what scoping to give each import. The default is always lexical. : : There are a few

Re: Transliteration preferring longest match

2005-12-15 Thread Larry Wall
On Thu, Dec 15, 2005 at 06:50:19PM +0100, Brad Bowman wrote: : : Hi, : : S05 describes an array version of trans for transliteration: : ( http://dev.perl.org/perl6/doc/design/syn/S05.html#Transliteration ) : : The array version can map one-or-more characters to one-or-more : characters: :

Re: Modular versions and APIs

2005-12-09 Thread Larry Wall
On Thu, Dec 08, 2005 at 11:16:52PM -0500, Rob Kinyon wrote: : On 12/8/05, Larry Wall [EMAIL PROTECTED] wrote: : [snip] Certainly, as you speculate, if different authors want : to share an API, they can give it an API author that knows how to : delegate to one of the authors. : : Would you

Re: Clarification for External Regex Variables?

2005-12-08 Thread Larry Wall
On Thu, Dec 08, 2005 at 11:14:16PM +0100, Brad Bowman wrote: : Hello, : : I'd like to get clarification on the scoping of variables : bound in a regex. It's described in S05 as follows: : : External aliasing : : * Instead of using internal aliases like: : : m/ mv @files:=ident+

Re: Perl grammar for Perl5 - Perl6

2005-12-08 Thread Larry Wall
or something like that could also : help. Sure, but some of our toys are bigger than others. :-) : Is there such a Perl5-Perl6 translator underway? : : Larry Wall is working on using the perl (5) interpreter to create : compiled output (as opposed to just something that executes in : memory) that can

Re: the $! too global

2005-12-08 Thread Larry Wall
On Wed, Dec 07, 2005 at 09:43:31AM +0100, TSa wrote: : HaloO, : : Larry Wall wrote: : My gut-level feeling on this is that $! is going to end up being an : env variable like $_. : : I just re-read about exceptions. Well, I undestand now that $! is : intented as a variable with a spectrum

Re: Perl grammar for Perl5 - Perl6

2005-12-08 Thread Larry Wall
On Thu, Dec 08, 2005 at 01:46:51PM -0500, Rob Kinyon wrote: : As for the original question, I think that the Perl 6 grammar will : be a much better example for how to parse other languages than a : Perl 5 grammar would be, since one of the underlying design currents : from the beginning has

Re: Perl grammar for Perl5 - Perl6

2005-12-08 Thread Larry Wall
On Thu, Dec 08, 2005 at 01:10:14PM -0600, Jonathan Scott Duff wrote: : The same holds for parsing perl6 only the twisty maze isn't there (or is : at least much much smaller) Hmm. Maybe... Perl 5 is a twistly maze of passages all different. Perl 6 is a twistly maze of passages all

Re: Modular versions and APIs

2005-12-08 Thread Larry Wall
It's probably not entirely clear in the spec, but it is already the intent that version numbers work as API designators as well as module designators. Certainly, as you speculate, if different authors want to share an API, they can give it an API author that knows how to delegate to one of the

Re: the $! too global

2005-12-05 Thread Larry Wall
My gut-level feeling on this is that $! is going to end up being an env variable like $_. (If you don't know what env is then you've not read the conjectural parts of S2 lately.) Then the problem reduces to what you do with an unhandled $! at the end of a lexical scope, which is probably just to

Re: Capabilities in Perl6?

2005-12-01 Thread Larry Wall
On Thu, Dec 01, 2005 at 10:54:14AM -0500, Rob Kinyon wrote: : I just read the slides about CAPerl (http://caperl.links.org/) and it's an : interesting idea. Leaving aside the question of whether this would work in : Perl5 or not, I think it would be very interesting to look at building this :

Re: statement_controlfoo()

2005-11-30 Thread Larry Wall
On Wed, Nov 30, 2005 at 06:36:22PM +, Piers Cawley wrote: : $fh = open '', 'quotefile' or fail; : $fh.print 'EOQ' : I like witty sayings as much as the next guy, but wit can hurt when : misdirected. If people want me to be machine for cranking out quote : file fodder, I'll do my best. But I

Re: type sigils redux, and new unary ^ operator

2005-11-24 Thread Larry Wall
On Thu, Nov 24, 2005 at 12:08:44AM +0100, Stéphane Payrard wrote: : What about array with holes as supported by Parrot? We have prior art with hashes, but it's not clear how well that maps across. : Does .elems return the number of elements with or without : the holes? In Perl 5, non-existing

Re: type sigils redux, and new unary ^ operator

2005-11-24 Thread Larry Wall
On Thu, Nov 24, 2005 at 12:42:25PM +0100, Juerd wrote: : Ruud H.G. van Tol skribis 2005-11-24 10:36 (+0100): : it's about expression. : Also if [EMAIL PROTECTED] is the multi-dimensional index zip? : : No. : : However, it does feel weird to have an *operator* that makes an array : behave in a

Re: implied looping (was: Re: type sigils redux, and new unary ^ operator)

2005-11-23 Thread Larry Wall
On Wed, Nov 23, 2005 at 02:23:51PM +0100, Ruud H.G. van Tol wrote: : Larry Wall: : : for ^5 { say } # 0, 1, 2, 3, 4 : : The 'for' can go if a list (and also an array) would imply looping, when : it is positioned next to a block: : : a. say (0..4); : b. { say; say } (0..4); : c. (0..4

Re: type sigils redux, and new unary ^ operator

2005-11-23 Thread Larry Wall
On Wed, Nov 23, 2005 at 11:58:23AM -0500, Rob Kinyon wrote: : Here's an issue - if ^$x would be one($x), then what will [EMAIL PROTECTED] be? To : me, that seems like it should be one(@x), which is entirely useful. : Except, if I try and use it as [EMAIL PROTECTED] (which, to me, would be

Re: type sigils redux, and new unary ^ operator

2005-11-23 Thread Larry Wall
On Wed, Nov 23, 2005 at 11:55:35AM -0500, Matt Fowles wrote: : I think using C ..5 to mean (0, 1, 2, 3, 4) would be a more : sensible option. Makes sense to me at least. That doesn't derive well from any of: .. ^.. ..^ ^..^ If the rule is you can omit the 0, then it's ..^5

Re: type sigils redux, and new unary ^ operator

2005-11-23 Thread Larry Wall
On Wed, Nov 23, 2005 at 07:10:39PM +0100, Juerd wrote: : Ruud H.G. van Tol skribis 2005-11-23 19:03 (+0100): : Doesn't ^5 encourage [EMAIL PROTECTED] too much? : Can you explain when that creates a problem? : : It's not about problems in execution, it's about expression. : : [EMAIL PROTECTED]

Re: type sigils redux, and new unary ^ operator

2005-11-23 Thread Larry Wall
On Wed, Nov 23, 2005 at 10:45:21AM -0800, Mark A. Biggar wrote: : Actually I like that and think that ^$x should be 0..($x-1) and that : [EMAIL PROTECTED] should be define to return the array's index set (usually : 0..$#foo) but maybe something else for a non-zero based array. Well, as I said

Re: type sigils redux, and new unary ^ operator

2005-11-23 Thread Larry Wall
On Wed, Nov 23, 2005 at 10:58:53AM -0800, Larry Wall wrote: : Well, as I said in my other reply, that's not a big problem for : 1-dimensional arrays. But it does possibly make sense that ^ on a : multidimensional array or hash would return a zip of all the key sets. : Plus it generalizes ^%hash

Re: Lazy lists in Str context

2005-11-23 Thread Larry Wall
On Wed, Nov 23, 2005 at 12:07:08PM -0500, Rob Kinyon wrote: : On 11/23/05, Flavio S. Glock [EMAIL PROTECTED] wrote: : OTOH, it would be nice if : :say substr( ~(1..Inf), 0, 10 ) : : printed 1 2 3 4 5. : This would work, I think, if ranges were convertable to iterators, Range objects are

Re: Lazy lists in Str context

2005-11-23 Thread Larry Wall
On Wed, Nov 23, 2005 at 05:24:11PM -0200, Flavio S. Glock wrote: : Ah, ok - but I believe that say() is slurpy, which means the list must : be instantiated first. It's * instantiated, but not ** instantiated, so the iterators buried in the .specs of the list aren't forced to evaluate yet. And

Re: Lazy lists in Str context

2005-11-23 Thread Larry Wall
On Wed, Nov 23, 2005 at 08:35:09PM +0100, Juerd wrote: : Larry Wall skribis 2005-11-23 11:16 (-0800): : Range objects are supposed to *be* iterators, but pugs isn't there yet, : last I checked. : : Is the associated sigil @ or $? Either way, there's a problem. No, either way it does what you

Re: type sigils redux, and new unary ^ operator

2005-11-23 Thread Larry Wall
On Wed, Nov 23, 2005 at 02:21:15PM -0500, Matt Fowles wrote: : I like C ..^5 better than C ^5 actually. I was going for the : rule that an omitted LHS was 0 and an omitted RHS was infinity (your : probably cannot omit both). But that only saves you 1 keystroke, and eliminates unary .. for any

Re: type sigils redux, and new unary ^ operator

2005-11-23 Thread Larry Wall
On Wed, Nov 23, 2005 at 08:04:32AM -0800, Peter Scott wrote: : On Tue, 22 Nov 2005 14:34:12 -0800, Larry Wall wrote: : What tipped me over the edge, however, is that I want ^$x back for a unary : operator that is short for 0..^$x, that is, the range from 0 to $x - 1. I : kept wanting

Re: \x{123a 123b 123c}

2005-11-22 Thread Larry Wall
On Mon, Nov 21, 2005 at 11:25:20AM -0600, Patrick R. Michaud wrote: : On Mon, Nov 21, 2005 at 09:02:57AM -0800, Larry Wall wrote: : : There's also sp, unless someone redefines the sp subrule. : : But you can't use sp in a character class. Well, that is, unless : you write

Re: statement_controlfoo() (was Re: lvalue reverse and array views)

2005-11-22 Thread Larry Wall
On Tue, Nov 22, 2005 at 10:12:00AM +0100, Michele Dondi wrote: : Oh, I'm not the person you were responding to, and probably the less : entitled one to speak in the name of everyone else here, but I feel like : doing so to say that in all earnestness I'm quite sure no one took any : offense out

Re: \x{123a 123b 123c}

2005-11-22 Thread Larry Wall
On Tue, Nov 22, 2005 at 08:19:04PM +1100, Damian Conway wrote: : And perhaps we'd want a general form for specifying other : pattern syntaxes; i.e., :perl5 and :glob are shortcuts for : :syntax('perl5') and :syntax('glob') or something like that. : : Agreed. But the language in the following

Re: \x{123a 123b 123c}

2005-11-22 Thread Larry Wall
On Tue, Nov 22, 2005 at 09:46:59AM -0800, Dave Whipp wrote: : Larry Wall wrote: : : And there aren't that many regexish languages anyway. So I think :syntax : is relatively useless except for documentation, and in practice people : will almost always omit it, which makes it even less useful

Re: \x{123a 123b 123c}

2005-11-22 Thread Larry Wall
On Tue, Nov 22, 2005 at 12:48:39PM -0600, Patrick R. Michaud wrote: : On Mon, Nov 21, 2005 at 09:02:57AM -0800, Larry Wall wrote: : On Sun, Nov 20, 2005 at 10:27:17AM -0600, Patrick R. Michaud wrote: : : On Sat, Nov 19, 2005 at 06:32:17PM -0800, Larry Wall wrote: : : We already have, from A5

Re: dis-junctive patterns

2005-11-22 Thread Larry Wall
On Tue, Nov 22, 2005 at 09:31:27AM +0200, Gaal Yahas wrote: : In pugs, r7961: : : my @pats = /1/, /2/; : say MATCH if 1 ~~ any @pats; # MATCH : say MATCH if 0 ~~ any @pats; # no match : : So far so good. But: : : my $junc = any @pats; : say MATCH if 1 ~~ $junc; # no

type sigils redux, and new unary ^ operator

2005-11-22 Thread Larry Wall
I'm changing my mind about type sigils. After playing around with ^ for a while, I find it's useful only in signatures and declarations, and I'm generally forced to omit it when using it within inner declarations, or it would redeclare the type. Taking that together with the fact that it

Re: \x{123a 123b 123c}

2005-11-21 Thread Larry Wall
On Sun, Nov 20, 2005 at 10:27:17AM -0600, Patrick R. Michaud wrote: : On Sat, Nov 19, 2005 at 06:32:17PM -0800, Larry Wall wrote: : On Sun, Nov 20, 2005 at 01:26:21AM +0100, Juerd wrote: : : Ruud H.G. van Tol skribis 2005-11-20 1:19 (+0100): : : Maybe : : \x{123a 123b 123c

Re: apo5 (was: Re: \x{123a 123b 123c})

2005-11-21 Thread Larry Wall
On Mon, Nov 21, 2005 at 05:49:59PM +0100, Ruud H.G. van Tol wrote: : Larry Wall: : Juerd: : Ruud: : : Maybe : \x{123a 123b 123c} : is a nice alternative of : \x{123a} \x{123b} \x{123c}. : : Hmm, very cute and friendly! Can we keep it, please? Please? : : Thanks for the support

Re: \x{123a 123b 123c}

2005-11-21 Thread Larry Wall
On Mon, Nov 21, 2005 at 09:02:57AM -0800, Larry Wall wrote: : But I'd like to reserve for delimiting what is returned by $, : the string officially matched: : : foo bar baz ~~ /:w foo \w+ baz/ : say $/; # foo bar baz : say $; # bar Though it occurs to me that there's another

Re: statement_controlfoo() (was Re: lvalue reverse and array views)

2005-11-21 Thread Larry Wall
On Mon, Nov 21, 2005 at 03:51:19PM +, Luke Palmer wrote: : On 11/21/05, Ingo Blechschmidt [EMAIL PROTECTED] wrote: : Of course, the compiler is free to optimize these things if it can prove : that runtime's statement_control:if is the same as the internal : optimized statement_control:if. :

Re: statement_controlfoo() (was Re: lvalue reverse and array views)

2005-11-21 Thread Larry Wall
On Mon, Nov 21, 2005 at 10:45:56AM -0800, Larry Wall wrote: : Another issue in if optimization is whether the blocks in fact do : anything blockish that have to be scoped to the block. This is a : determination that Perl 5 makes when it's compiling blocks. It's : basically an attribute

Re: Multidimensional argument list binding (*@;foo)

2005-11-21 Thread Larry Wall
On Sun, Nov 20, 2005 at 09:11:33PM +0100, Ingo Blechschmidt wrote: : Also, is specifying other, non-slurpy arguments prior to a slurpy : @;multidim_arglist legal? Yes, though we have to be careful about what happens when we bind the entire first dimension and then get a == boundary. That's

Re: Multidimensional argument list binding (*@;foo)

2005-11-21 Thread Larry Wall
On Mon, Nov 21, 2005 at 03:48:30PM +, Luke Palmer wrote: : To illustrate: : : sub foo ([EMAIL PROTECTED]) { : say [EMAIL PROTECTED]; : } : sub bar (*@;a) { : say +@;a; : } : foo(1,2,3; 4,5,6); # 6 : bar(1,2,3; 4,5,6); # 2 : : That is, the regular

Re: Multidimensional argument list binding (*@;foo)

2005-11-21 Thread Larry Wall
On Mon, Nov 21, 2005 at 07:49:16PM +0100, Ingo Blechschmidt wrote: : Aha! FYI, I got that interpretation from r6628 of S09 [1]: : The following two constructs are structurally indistinguishable: : : (0..10; 1,2,4; 3) : ([0..10], [1,2,3,4], [3]) Sorry, started revising that one a

Re: statement_controlfoo() (was Re: lvalue reverse and array views)

2005-11-21 Thread Larry Wall
On Mon, Nov 21, 2005 at 02:05:31PM -0500, Rob Kinyon wrote: : This is very close to a proposal I made to the ruby-dev mailing list : (which was Warnocked). I proposed a very basic engine that would work : with the parser/lexer to determine what action to take instead of : using the huge case

Re: apo5

2005-11-21 Thread Larry Wall
On Mon, Nov 21, 2005 at 07:57:59PM +0100, Ruud H.G. van Tol wrote: : There is a [[:alpha:][:digit:] and a [[:alpha:][:digit]] on the : A5-page. Hmm, well, thanks--I went to fix it and I see Patrick beat me to the fix. But in one of the updates, it says: +[Update: Actually, that's now

Re: statement_controlfoo() (was Re: lvalue reverse and array views)

2005-11-21 Thread Larry Wall
On Mon, Nov 21, 2005 at 11:43:21AM -0800, Larry Wall wrote: : Let's see, where did I put my stash of generic quotes? I would like to publicly apologize for my remarks, which were far too harsh for the circumstances. I can only plead that I was trying to be far too clever, and not thinking about

Re: till (the flipflop operator, formerly ..)

2005-11-20 Thread Larry Wall
On Sun, Nov 20, 2005 at 08:51:03PM +0100, Ingo Blechschmidt wrote: : Hi, : : according to the new S03, till is the new name for the flipflop : operator. Presuming we can make it work out as an infix macro. : Do the flipflop operators of subroutines maintain own : per-invocation-of-the-sub

Re: Private behavior in roles

2005-11-19 Thread Larry Wall
On Thu, Nov 17, 2005 at 01:55:31PM -0800, Ovid wrote: : In http://perlmonks.org/?node_id=509413 (in response to : http://perlmonks.org/?node_id=509256), Rob Kinyon wrote that in his : understanding of Perl 6 Roles, anything a role can do the class doing : the role should also be able to do. : :

Re: \x{123a 123b 123c}

2005-11-19 Thread Larry Wall
On Sun, Nov 20, 2005 at 01:26:21AM +0100, Juerd wrote: : Ruud H.G. van Tol skribis 2005-11-20 1:19 (+0100): : Maybe : \x{123a 123b 123c} : is a nice alternative of : \x{123a} \x{123b} \x{123c}. : : Hmm, very cute and friendly! Can we keep it, please? Please? We already have,

Re: ='s autoquoted identifiers

2005-11-18 Thread Larry Wall
On Thu, Nov 17, 2005 at 10:05:55PM -0700, Luke Palmer wrote: : On 11/17/05, Joshua Choi [EMAIL PROTECTED] wrote: : But what does that mean for ='s signature? What type would be its : first parameter? Would you call it infix:{'='}:(Bareword | Any, : Any) or something like that? And in any case,

Re: ='s autoquoted identifiers

2005-11-18 Thread Larry Wall
On Fri, Nov 18, 2005 at 12:12:02PM +0100, TSa wrote: : I hope all these are now the same: : : foo = bar ; # result of evaluating bar available under foo key : :foo( bar ); : :foobar ; # does that exist? No. :foo with trailing whitespace is taken to mean :foo(1), so the bar would

Classification syntax [Was: Renaming grep]

2005-11-18 Thread Larry Wall
On Fri, Nov 18, 2005 at 03:31:10AM +0200, Ilmari Vacklin wrote: : Hi all, : : I think that grep should be renamed to something English and more, well, : semantic. 'Filter' comes to mind as a suggestion. I realise there's a : lot of cultural background (from Unix and Perl 5) that favours 'grep', :

Re: Test Case: Complex Numbers

2005-11-18 Thread Larry Wall
On Fri, Nov 18, 2005 at 06:54:42PM -0200, Flavio S. Glock wrote: : 2005/11/11, Larry Wall [EMAIL PROTECTED]: : : While you're there, also think about the gray area between arrays and hashes, : and whether .[...] subscripts are just a specialized form of .{...} subscripts. : : By the way

Re: Test Case: Complex Numbers

2005-11-18 Thread Larry Wall
On Thu, Nov 17, 2005 at 10:18:19PM +0100, TSa wrote: : Another idea is to model nums to have a directional bit where the : polar complex have a full range angle. This whole thing strikes me as a units problem. Much like we don't care if the internal representation is meters or furlongs, so long

Re: Classification syntax [Was: Renaming grep]

2005-11-18 Thread Larry Wall
On Fri, Nov 18, 2005 at 01:41:33PM -0800, Brent 'Dax' Royal-Gordon wrote: : Larry Wall [EMAIL PROTECTED] wrote: : The name is relatively unimportant in the overall scheme of things. : I'm more worried about the fact that it's difficult to partition a : list into multiple lists in one pass

Re: Hyphens vs. Underscores

2005-11-17 Thread Larry Wall
On Thu, Nov 17, 2005 at 10:56:27AM +0100, Daniel Brockman wrote: : That problem is not specific to this feature. For any package : that changes the syntax, you can ask what about eval? : : So... what *about* eval? :-) Always parses with the parser in effect at that point, the same one you'd get

Re: Chained buts optimizations?

2005-11-15 Thread Larry Wall
On Tue, Nov 15, 2005 at 02:11:03PM -0500, Aaron Sherman wrote: : All of that is fine, as far as I'm concerned, as long as we give the : user the proviso that chained buts might be optimized down into a single : cloning operation or not at the compiler's whim, but it could be a nasty : shock if

Re: context matters

2005-11-15 Thread Larry Wall
On Tue, Nov 15, 2005 at 12:32:38PM -0600, Patrick R. Michaud wrote: : On Tue, Nov 15, 2005 at 10:26:05AM -0800, jerry gay wrote: : Thus, while PGE::Match currently defines a C__get_pmc_keyed_int : method, it's doesn't yet define a C__get_string_keyed_int method. : So, a statement like : :

Re: Chained buts optimizations?

2005-11-15 Thread Larry Wall
On Tue, Nov 15, 2005 at 03:43:59PM -0500, John Macdonald wrote: : On Tue, Nov 15, 2005 at 11:23:49AM -0800, Larry Wall wrote: : On Tue, Nov 15, 2005 at 02:11:03PM -0500, Aaron Sherman wrote: : : All of that is fine, as far as I'm concerned, as long as we give the : : user the proviso

Re: What's the latest on Iterators?

2005-11-12 Thread Larry Wall
On Sat, Nov 12, 2005 at 03:05:53PM +0100, Stéphane Payrard wrote: : Larry Wall a écrit : : | On Fri, Nov 11, 2005 at 08:42:44AM -0500, Joe Gottman wrote: : | : Do functions like map and grep, which in Perl5 return lists, return : | : Iterators in Perl6? : | : | A list may contain iterators

Re: Test Case: Complex Numbers

2005-11-11 Thread Larry Wall
On Fri, Nov 11, 2005 at 06:21:53AM +, Luke Palmer wrote: : Just some initial thoughts and syntax issues. I'll come back to it on : the conceptual side a little later. : : On 11/10/05, Jonathan Lang [EMAIL PROTECTED] wrote: : : class complexRectilinear { :has $.x, $.y; : : Hmm, that

Re: What's the latest on Iterators?

2005-11-11 Thread Larry Wall
On Fri, Nov 11, 2005 at 08:42:44AM -0500, Joe Gottman wrote: : Do functions like map and grep, which in Perl5 return lists, return : Iterators in Perl6? A list may contain iterators. Lists don't eagerly flatten in Perl 6. : Can an Iterator be passed to a function (like map and grep again) :

Re: proposal: rename 'subtype' declarator to 'set'

2005-11-11 Thread Larry Wall
On Wed, Nov 09, 2005 at 01:45:21PM +0100, TSa wrote: : So, why not call the thing what it is---a set *type* declarator! : : set SmallInt of Int where { abs 10 }; : : set SomeNums of Num = (3.14, 4, 89, 23.42); : : set Bit of Int = (0,1); Interesting idea. I expect a bit of interference

Re: given too little

2005-11-10 Thread Larry Wall
On Thu, Nov 10, 2005 at 10:11:50AM +0100, TSa wrote: : HaloO, : : Gaal Yahas wrote: : I know why the following doesn't work: : : given $food { : when Pizza | Lazagna { .eat } : when .caloric_value $doctors_orders { warn no, no no } : # ... : } : : The

Re: Ways to add behavior

2005-11-08 Thread Larry Wall
On Mon, Nov 07, 2005 at 08:44:28PM +0100, TSa wrote: : HaloO, : : Larry Wall wrote: : : ::Takes3Ints ::= :(Int,Int,Int -- Any); : : : : my foo:(Takes3Ints); : : I'd say that has to be something like: : : my foo:(Takes3Ints:); : : or maybe one of : : my foo

Re: private methods and role composition

2005-11-08 Thread Larry Wall
On Sat, Nov 05, 2005 at 11:35:38AM -0800, Jonathan Lang wrote: : First off: is there a way to declare a method as being private to a role? We're still batting around the notion of private methods. Certainly with a lexically scoped sub you can get most of the same benefit. Trust could then

Re: Ways to add behavior

2005-11-07 Thread Larry Wall
On Mon, Nov 07, 2005 at 01:05:16PM +0100, TSa wrote: : With the introduction of kind capture variables ^T we could complety : drop the subtype special form. As you pointed out the adding of constraints : happens with the where clause anyway. Thus we return to the usage of the : compile time name

Re: Ways to add behavior

2005-11-07 Thread Larry Wall
On Mon, Nov 07, 2005 at 09:37:04AM -0800, Larry Wall wrote: : It would be nice to generalize this sufficiently to be able to declare : polymorphic objects resembling match objects: : :my $matchobj(Poly: Key^Int^Notthere -- Any); : : Or maybe that should be: : :my $matchobj\(Highlander

Re: ='s container and binding semantics

2005-11-07 Thread Larry Wall
On Sun, Nov 06, 2005 at 03:10:40PM +0100, Ingo Blechschmidt wrote: : Hi, : : my ($key, $value) = key val; : my $pair = ($key = $value); : : $pair.key = new; : # Should this fail (cannot modify a constant)? : # Should this update $pair.key, but leave $key untouched? :

Re: ='s container and binding semantics

2005-11-07 Thread Larry Wall
On Mon, Nov 07, 2005 at 11:53:26AM -0800, Larry Wall wrote: : Also, if we provide a way to return a pair instead of a value from a : hash (currently done with the new :%hashkey syntax), Whoops, I forgot I changed that to %hash:key (and %hash:{'key'} too). Larry

Re: Perl6 perlplexities [was: Re: $1 change issues...]

2005-11-07 Thread Larry Wall
On Mon, Nov 07, 2005 at 09:51:39PM +0100, Juerd wrote: : Or let's take this simple example: : : sub convert (:$from, :$to, :$thing) { ... } : : That isn't quite my %args = @_;. Yes, that works, but the only real : way we keep doing it is that the full solution sucks in plain Perl 5: : :

Re: ='s container and binding semantics

2005-11-07 Thread Larry Wall
On Mon, Nov 07, 2005 at 11:20:39PM +0200, Ilmari Vacklin wrote: : On Mon, Nov 07, 2005 at 12:05:30PM -0800, Larry Wall wrote: : On Mon, Nov 07, 2005 at 11:53:26AM -0800, Larry Wall wrote: : : Also, if we provide a way to return a pair instead of a value from a : : hash (currently done

Re: Ways to add behavior

2005-11-05 Thread Larry Wall
On Sat, Nov 05, 2005 at 01:55:11AM +0100, TSa wrote: : Larry Wall wrote: : The notion of constraints or limitations is already conveyed by : where, and some subtypes may just be aliases. : : Wouldn't 'bound' work? Perhaps combined with 'on': : : bound SmallInt on Int where { 0 $_ 100

Re: co/contra variance of roles/factories in theory.pod

2005-11-04 Thread Larry Wall
On Fri, Nov 04, 2005 at 12:37:04PM +0100, TSa wrote: : The above also describes my perception of the $. twigil notation which : are variables bound through the invocant(s). My mental picture beeing : one where a method is instanciated as a not yet invoked sub after selecting : the target code body

Re: new sigil

2005-11-04 Thread Larry Wall
On Fri, Nov 04, 2005 at 08:14:11PM +0100, TSa wrote: : HaloO, : : Larry Wall wrote: : On Tue, Oct 25, 2005 at 10:25:48PM -0600, Luke Palmer wrote: : : Yeah, I didn't really follow his argument on that one. I, too, think : : that the one() junction in general is silly, especially for types

Re: Is there a way to generate an object without new?

2005-10-27 Thread Larry Wall
On Thu, Oct 27, 2005 at 01:30:44PM -0600, Luke Palmer wrote: : On 10/27/05, Yiyi Hu [EMAIL PROTECTED] wrote: : What I want to do, is a bit like... : : class A { : has $.b; : method show { $.b.say }; : }; : : A( b = 5 ).show;` : : Yes, I definitely want this to be the way that case type

Re: Roles vs. Classes (was Re: Ways to add behavior)

2005-10-27 Thread Larry Wall
On Thu, Oct 27, 2005 at 05:37:13AM -0400, Rob Kinyon wrote: : Will I be able to do something like: : : package Foo; Hmm, you just started in Perl 5 mode. : $*VERSION = 1.3.2; Perl 5 would get confused here, so I'm presuming Perl 6. But Perl 6 isn't likely to let you override the global

Re: txt vs OO [was: Re: Proposal to make class method non-inheritable]

2005-10-26 Thread Larry Wall
On Wed, Oct 26, 2005 at 09:36:48AM +0200, Michele Dondi wrote: : On Tue, 25 Oct 2005, Larry Wall wrote: : : But we're trying to design the OO features (indeed, all of Perl 6) : such that you can usefully cargo cult those aspects that are of : immediate interest without being forced to learn

+$arg changed to :$arg

2005-10-26 Thread Larry Wall
I should point out that one of the major changes in the most recent S6 is that named arguments are now marked by : rather than +, with :foo($bar) being the way to declare parameter $bar but give it the external name of foo. A + is now reserved to mark mandatory parameters, though it's redundant

Re: new sigil

2005-10-26 Thread Larry Wall
On Tue, Oct 25, 2005 at 10:25:48PM -0600, Luke Palmer wrote: : Yeah, I didn't really follow his argument on that one. I, too, think : that the one() junction in general is silly, especially for types. Well, I think it's silly too. I'm just trying to see if we need to reserve the syntax in case

Re: +$arg changed to :$arg

2005-10-26 Thread Larry Wall
On Wed, Oct 26, 2005 at 10:06:25AM -0400, Matt Fowles wrote: : Larry~ : : On 10/26/05, Larry Wall [EMAIL PROTECTED] wrote: : So we'd get: : : :@array[42] 42 = @array[1] : : Do you mean C :@array[42] 42 = @array[42] ? Yes. I was changing it because 42 : 1 :: foo : a, but I flubbed

Re: +$arg changed to :$arg

2005-10-26 Thread Larry Wall
On Wed, Oct 26, 2005 at 04:02:06PM +0200, Juerd wrote: : Larry Wall skribis 2005-10-26 6:44 (-0700): : I should point out that one of the major changes in the most recent : S6 is that named arguments are now marked by : rather than +, with : :foo($bar) being the way to declare parameter $bar

Re: +$arg changed to :$arg

2005-10-26 Thread Larry Wall
It also means you could write a prototype that looks like :(!, !, !, ?, ?) We don't need no stinkin' _. There's more than one way to not care. (I guess that means that in addition to supporting interesting values of undef, we also support interesting values of not caring...) But does that

Re: Ways to add behavior

2005-10-26 Thread Larry Wall
On Tue, Oct 25, 2005 at 05:17:40PM -0400, Stevan Little wrote: : Larry, : : On Oct 25, 2005, at 4:37 PM, Larry Wall wrote: : On Mon, Oct 24, 2005 at 06:33:20AM -0700, Ashley Winters wrote: : : # behavior through prototype -- guessing realistic syntax : : Base.meta.add_method( : : do_it

Re: +$arg changed to :$arg

2005-10-26 Thread Larry Wall
On Wed, Oct 26, 2005 at 04:59:04PM +0200, Juerd wrote: : Larry Wall skribis 2005-10-26 7:31 (-0700): : One slightly serious ramification of the : switch is that the space : is required after the colon indicating a null invocant. : method doit (: $a, $b, $c) : : Or, we could separate

Re: Ways to add behavior

2005-10-26 Thread Larry Wall
On Wed, Oct 26, 2005 at 11:31:28AM -0400, Rob Kinyon wrote: : That's just self.meta.add_method($label, $method) by my lights. : A .meta already implies/ignores the .class coercion. If we are to : support prototype-based programming $x.meta *must not care* whether : it has been given a class

Re: Ways to add behavior

2005-10-26 Thread Larry Wall
On Wed, Oct 26, 2005 at 12:22:07PM -0400, Stevan Little wrote: : : On Oct 26, 2005, at 12:05 PM, Larry Wall wrote: : Of course, there are other words that are somewhat synonymous with : class, Unfortunately sort is already hosed. Maybe kind. : : Actually kind is used in the Core Calculus

Re: +$arg changed to :$arg

2005-10-26 Thread Larry Wall
On Wed, Oct 26, 2005 at 07:06:15PM +0200, TSa wrote: : HaloO, : : Larry Wall wrote: : On Wed, Oct 26, 2005 at 04:59:04PM +0200, Juerd wrote: : : Larry Wall skribis 2005-10-26 7:31 (-0700): : : One slightly serious ramification of the : switch is that the space : : is required after the colon

Re: Ways to add behavior

2005-10-26 Thread Larry Wall
On Wed, Oct 26, 2005 at 03:54:35PM -0400, Rob Kinyon wrote: : So maybe we can define our terms like this: : : type: a completely generic metaterm for any of the following, : and then some. : : class: a mutable interface object that manages instances in the : classical way,

Re: Roles vs. Classes (was Re: Ways to add behavior)

2005-10-26 Thread Larry Wall
On Wed, Oct 26, 2005 at 08:48:12PM -0400, Rob Kinyon wrote: : If a role is an immutable class, that means that its internals cannot : be changed. Hence, the compiler can trust that it will be the same at : the end as at the beginning. Which means it's optimized. Which means : my objects run faster

Re: Ways to add behavior

2005-10-26 Thread Larry Wall
On Wed, Oct 26, 2005 at 04:56:23PM -0600, Luke Palmer wrote: : Then ^T $x binds T to the kind of $x. And $x.kind == $y.kind asks : if two objects are of the same type, : : Don't you mean $x.kind eqv $y.kind? : : Ugh. Now that infix::: has come available, maybe I mean: $x.kind :: $y.kind

<    3   4   5   6   7   8   9   10   11   12   >