Re: What does this do?

2002-05-07 Thread Larry Wall
Aaron Sherman writes: : On Fri, 2002-05-03 at 12:37, Larry Wall wrote: : Piers Cawley writes: : : Consider the following. : : : :sub foo {...} : : : :foo *@ary; : :foo * ary; : : : : Is this another place where whitespace will have meaning? Or should I : : add parentheses

Re: PRE-POST methods [Was: Selective exporting of properties/methods]

2002-05-13 Thread Larry Wall
end. : PS. One thing just pooped to me... is the class { } a block so that we can do all :block mumbo-jumbo with it :) Well, sure, but it probably only executes inline with the surrounding code, just as any module initialization code does in Perl 5. I don't think it's a BEGIN variant. Larry

Re: Why not {,n} in quantifiers?

2002-05-14 Thread Larry Wall
this: Perl 5 Perl 6 {1,3} 1..3 {3} 3 {3,}3+ {0,3} 3- Then again, maybe not... Larry

Re: Why not {,n} in quantifiers?

2002-05-15 Thread Larry Wall
in the general re-huffmanization of regexen. Larry

Re: FIRST, BETWEEN, etc.. (was Re: Loop controls)

2002-05-15 Thread Larry Wall
is indeterminate. Then you can at least get warnings if you try to use the undefined value later. The class could even tag the undef with a property containing an unthrown exception that explains why the length is indeterminate, since Perl 6 will support interesting values of undef. Larry

Re: Why not {,n} in quantifiers?

2002-05-15 Thread Larry Wall
Miko O'Sullivan writes: : From: Larry Wall [EMAIL PROTECTED] : It's unlikely that {n,m} will still have that meaning in Perl 6. Maybe : we'll : have something like this: : : Perl 5 Perl 6 : {1,3} 1..3 : {3} 3 : {3,} 3+ : {0,3} 3- : : What are your feelings

Re: Perl6 currying

2002-05-18 Thread Larry Wall
= div.with(y = 2); Larry

Re: Perl6 currying

2002-05-18 Thread Larry Wall
curry? And is that red, yellow, or green curry? Larry

Re: Accessor methods ?

2002-05-19 Thread Larry Wall
it : paid for. But methods don't have a unique sub ref until you know the type. One could inline a jump table of sub refs based on known types, and default to ordinary method lookup for unknown types. But there's no guarantee that would actually be faster than a decent vtable lookup. Larry

Re: Using closures for regex control

2002-05-19 Thread Larry Wall
. Could even have a unary fail unless operator: / { assert /pat1/ } pat2 } / There might be a better word than assert. : # match pat2 if pat1 behind : / { .lookbehind /pat1/ } pat2 } / Sure, presuming .lookbehind knows how to fail. But after: pat1 is much more readable, I think. Larry

Re: Backslashes

2002-05-20 Thread Larry Wall
definition: my sub qa is quote(bsahfmc) {...} qa/\t $foo array %hash func() $obj.method() { closure }/ Then you could say something like: my sub q is quote() {...} 'You think I' _ q{'} _ 'm knit-picking!' to get the behavior you want. Larry

Re: Using closures for regex control

2002-05-20 Thread Larry Wall
control structure using nothing but closures. We could also change Perl's syntax to use nothing but parens, but we're not gonna. :-) Larry

Re: Perl6 currying

2002-05-28 Thread Larry Wall
We've pretty much settled on div.prebind(y = 2) as the most informative and least conflictive. Larry

Re: Half measures all round

2002-06-04 Thread Larry Wall
people can't leap tall buildings in a single bound. Larry

Re: Half measures all round

2002-06-04 Thread Larry Wall
. Larry

Re: Half measures all round

2002-06-04 Thread Larry Wall
. You wouldn't believe how ugly the transitional form between Perl 4 and Perl 5 was, when half the opcodes were interpreted by the old stacked interpreter, and half by the new stackless one. Larry

Re: 6PAN (was: Half measures all round)

2002-06-04 Thread Larry Wall
? Or has this stuff already been hashed out elsewhere and I missed : it? :) It's here and there. Some of it has been in my speeches, and some in the Apocalypses. Larry

Re: A5: Is this right?

2002-06-06 Thread Larry Wall
to be replaced by !metachar+ Nope, still gotta use [foo] if you want an atom larger than a character (whatever a character is...) Larry

Re: A5: Is this right?

2002-06-06 Thread Larry Wall
matter, if we put spaces around our square brackets and vertical bars, it won't look so much like a character class. I know we're all from the old school, but we should therefore be even more alert against excessive regex compaction. Larry

Re: Apoc 5 questions/comments

2002-06-07 Thread Larry Wall
On Fri, 7 Jun 2002, David Wheeler wrote: I was hoping for a magic array that would hold the actual *matches*, rather than pointers to their character positions. A5 says that $0 is that array. Larry

Re: Apoc 5 questions/comments

2002-06-07 Thread Larry Wall
, it returns undef. Larry

Re: Apoc 5 questions/comments

2002-06-08 Thread Larry Wall
. But it's fundamental to Perl 6 that the mumble of mumble { ... } is allowed to have control of how the ... is parsed. : Oh boy now I've gone and done it. *My* head's exploded. If your head has exploded, you should avoid sausage factories. Larry

Re: Apoc 5 questions/comments

2002-06-10 Thread Larry Wall
) use 'fail' INSIDE a regex? (I would assume not, but thought I'd check.) No, it'll be built-in. You'll only need to invoke the pragma to change the defaults. Larry

RE: lex behavior

2002-06-13 Thread Larry Wall
there could be a :longest that does that internally, and could optimize away cases that couldn't possibly be longest. (And possibly even invoke a DFA optimizer to make it one pass, in the absence of internal captures.) Larry

Re: More 6PAN musings: local namespaces

2002-06-18 Thread Larry Wall
On Tue, 18 Jun 2002, John Siracusa wrote: : On 6/18/02 6:10 PM, Damian Conway wrote: : Larry has previously mentioned the prospect of Perl 6 module names being : extended to include version number and author. : : If this were to be done, would seem reasonable for the author component

Re: Perl 6 Summary

2002-07-02 Thread Larry Wall
, that's the basic underlying problem with Ruby, as far as I can tell. In pursuing the principle of least surprise, they've merely swept the surprises elsewhere. Waterbed theory of surprise, if you will... Larry

Re: Perl 6, The Good Parts Version

2002-07-03 Thread Larry Wall
confusion if we can keep those terms straight. It was a mistake to call what Perl 5 has attributes, because that's a standard industry term for instance variables. Larry

Re: Perl 6 Summary

2002-07-03 Thread Larry Wall
; } That might not be enough info, though. May need to declare the parameters to have no arguments: sub check_it_out is inline (idx() is rw, val() is rw) { idx() = 0; val() = 7; } Larry

Re: what's new continued

2002-07-03 Thread Larry Wall
wanted). It *might* possibly work to hyper the constructor: my ($a, $b) = ^new Foo : 7.) Quantum superpositions === : : if ($x == any($a, $b, $c) { ... } The wave function of QS has not yet collapsed in Perl 6. It's still in the same state(s) as the cat. Larry

Re: greedy/non-greedy regex assertions

2002-07-04 Thread Larry Wall
On Thu, 4 Jul 2002, Ashley Winters wrote: : On Thursday 04 July 2002 10:47 am, Larry Wall wrote: : On Thu, 4 Jul 2002, Ashley Winters wrote: : So I'd guess that we just don't talk about :-1, but rather say that : : *$min..$max : : is naturally greedy, and as with any quantifier you

Re: Ruby iterators and blocks (was: Perl 6 Summary)

2002-07-04 Thread Larry Wall
. 'my' or 'local' in Perlspeak). Much too : easy to mangle existing variables like this. : : Most people agree. In the future there will be a way of doing that. : Matz himself has said so. Indeed, Ruby is the main reason I decided to keep my explicit in Perl 6. :-) Larry

Re: $RS paragraph mode going away?

2002-07-05 Thread Larry Wall
, slurp, rather than automatically concatenating all the files. for slurp - $file { ... } Larry

Re: Perl6 grammar (take IV)

2002-07-06 Thread Larry Wall
: incr := add.assuming(x = 1); Larry

Re: Perl 6 Summary

2002-07-06 Thread Larry Wall
think they understand it. Kind of like cancelling the dx's and dy's in calculus--the physics profs always tell you to do that, while warning you not to tell the math profs they're telling you to do that, because it doesn't always work, except in real life. Larry

Re: Light ideas

2002-08-02 Thread Larry Wall
On Fri, 2 Aug 2002, Nicholas Clark wrote: : On Fri, Aug 02, 2002 at 08:53:51AM -0400, Trey Harris wrote: : (With the possible exception of modules that disobey the laws of physics, : but I'm not putting anything past Larry... no strict 'physics' ;) : : Yay! : : $ cat infinite_compression.pl

Re: 'while {' in Perl 6

2002-08-09 Thread Larry Wall
a pointy sub might be expected.) Larry

Re: Copy-restore on parameters? (was Re: Autovivi)

2002-08-15 Thread Larry Wall
On Thu, 15 Aug 2002, Deven T. Corzine wrote: : I've got another idea. How about using a copy-restore technique? I suspect that would make Perl 6's sub calls even slower than Perl 5's. Larry

RE: Balanced Matches in Regexps?

2002-08-17 Thread Larry Wall
having to name it. That lets you write anonymous recursive rules, or possibly a generic rule that could have more than one name. Larry

Re: Balanced Matches in Regexps? + tr and hashes

2002-08-17 Thread Larry Wall
for even longer sequences of characters too, so some amount of preprocessing would be desirable to determine if one key was a prefix of another. Maybe it wants to get translated to some sort of trie parser. Really just depends on how much memory we want to throw at it to make it fast. Larry

Re: rule, rx and sub

2002-08-26 Thread Larry Wall
circles. Larry

Re: Hypothetical synonyms

2002-08-27 Thread Larry Wall
such hypotheticals into. Larry

Re: Hypothetical synonyms

2002-08-27 Thread Larry Wall
On 27 Aug 2002, Uri Guttman wrote: : LW == Larry Wall [EMAIL PROTECTED] writes: : LW m{^\s*[ : LW $stuff:=(.*?) | : LW $stuff:=(\S+) : LW ]}; : : couldn't that be reduced to: : : m{^\s* $stuff := [ (.*?) | (\S+) ] }; : : the | will only return one

Re: Hypothetical synonyms

2002-08-27 Thread Larry Wall
On 27 Aug 2002, Uri Guttman wrote: : and quoteline might even default to for its delim which would make : that line: : : my ($fields) = /(quotelike|\S+)/; That just looks like: my $field = /shellword/; Larry

Re: auto deserialization

2002-08-28 Thread Larry Wall
. That is, for ordinary data a bare {...} is equivalent to is now, while for a subroutine definition it's more like is on_demand. Whatever. My coffee stream hasn't yet suppressed my stream of consciousness. Larry

Re: Does ::: constrain the pattern engine implementation?

2002-08-28 Thread Larry Wall
are exceeded. Even in language we often have to reparse sentences that are garden pathological. Why should computers be exempt? :-) Larry

Re: Does ::: constrain the pattern engine implementation?

2002-08-28 Thread Larry Wall
). Larry

RE: rule, rx and sub

2002-08-28 Thread Larry Wall
think the secret is to allow easy attachment of regex rules to sub and parameter declarations. There's little point in re-inventing regex syntax using declarations. The whole point of making Perl 6 parse itself with regexes is to make this sort of stuff easy. Larry

Re: auto deserialization

2002-08-28 Thread Larry Wall
the constructor isn't going to change. Again, though, assignment to a normal variable is unlikely to invoke a constructor in any case. Larry

Re: rule, rx and sub

2002-08-28 Thread Larry Wall
as a single args argument without having to play with splat. Larry

Re: Hypothetical synonyms

2002-08-29 Thread Larry Wall
Don't forget you can parameterize rules with subrules. I don't see any reason you couldn't write a pick (.*?) | (\S+) kind of rule and do whatever you like with the submatched bits. Larry

Re: declaring if and while (was: rule, rx and sub)

2002-08-29 Thread Larry Wall
the ball into the hole. And I'm happy if the ball ends up closer to the hole than it was. Larry

Re: backtracking into { code }

2002-08-30 Thread Larry Wall
+ } :rule bar { a foo b } Yes, it must. It's only rules embedded in closures that are exempt by default, I think. Larry

Re: backtracking into { code }

2002-08-30 Thread Larry Wall
operator is always the wrong answer even when it gives the right answer. I am not a purist. In case you hadn't noticed... Larry

Re: Regex query

2002-09-20 Thread Larry Wall
will make a ref in Perl 6: $arrayref = (1,2,3); Larry

Re: hotplug regexes, other misc regex questions

2002-09-20 Thread Larry Wall
be a :modifier to specifically turn off optimizations. : What possible outputs are legal for this: : : aaa =~ /( a { print 1 } | a { print 2 })* { print \n } x/ Lots. :-) Larry

RE: Passing arguments

2002-09-20 Thread Larry Wall
) is given($x) {...} Larry

Re: Regex query

2002-09-20 Thread Larry Wall
programmer would think. (In Perl 6 it's the length of the anonymous array, not the last value.) Larry

RE: Passing arguments

2002-09-20 Thread Larry Wall
On Fri, 20 Sep 2002, Brent Dax wrote: : Larry Wall: : # That binds the dynamically surrounding $_ to $x as an : # out-of-band parameter. Can also bind to $_ to make it the : # current topic. : : The problem I have with that is this: : : sub for_trace(*@array, block

RE: Passing arguments

2002-09-20 Thread Larry Wall
On 20 Sep 2002, Aaron Sherman wrote: : On Fri, 2002-09-20 at 10:36, Larry Wall wrote: : On Thu, 19 Sep 2002, Brent Dax wrote: : : : (An aside: it strikes me that you could use Cgiven as a scoped lexical : : alias, i.e. : : given $bar - $foo { : : print $foo; : : } : : Sure

RE: Passing arguments

2002-09-20 Thread Larry Wall
//= seems to imply otherwise. And //= is too visually disruptive to the signature. Larry

Re: hotplug regexes, other misc regex questions

2002-09-20 Thread Larry Wall
On Fri, 20 Sep 2002, Sean O'Rourke wrote: : On Fri, 20 Sep 2002, Larry Wall wrote: : But if a fast implementation needs to keep pointers into a string : rather than offsets from the beginning, we're asking for core dumps if : the string is modified out from under the pointers, or we have

Re: Regex query

2002-09-20 Thread Larry Wall
On Fri, 20 Sep 2002, John Williams wrote: : On Fri, 20 Sep 2002, Larry Wall wrote: : : Yes, in fact any list forced into scalar context will make a ref in Perl 6: : : $arrayref = (1,2,3); : : That would seem to obviate the need for brackets to define array : references. Is there any

RE: Passing arguments

2002-09-20 Thread Larry Wall
On Fri, 20 Sep 2002, Sean O'Rourke wrote: : On Fri, 20 Sep 2002, Larry Wall wrote: : The current thinking as of Zurich is that the given passes in : separate from the ordinary parameters: : : sub ($a,$b,$c) is given($x) {...} : : That binds the dynamically surrounding $_ to $x as an out

Re: RFC: [] as the solitary list constructor

2002-10-05 Thread Larry Wall
= { a = 1, b = 2 }; : : will now DWIM. Well, that one can be caught, if not the other one. Again, the right approach to dealing with references is probably to bind: %hash := { a = 1, b = 2 }; Larry

Re: RFC: [] as the solitary list constructor

2002-10-08 Thread Larry Wall
decision was that = will appear to work exactly as it does in Perl 5, while all the new semantics get put into := instead. In fact, = doesn't work exactly the same, because it lazily evaluates things like ranges and other potentially infinite lists. But that should be more or less transparent. Larry

Re: RFC: [] as the solitary list constructor

2002-10-08 Thread Larry Wall
could easily have used a special token like NULLLIST instead. What does INTERCAL use? Larry

Re: RFC: [] as the solitary list constructor

2002-10-08 Thread Larry Wall
On Sat, 5 Oct 2002, Chip Salzenberg wrote: : According to Larry Wall: : I suppose we could make comma merely puke in scalar context rather : than DWIM, at least optionally. : : I rather like Perl 5's scalar comma operator. Most of the uses of which are actually in void context, where

Re: for loop and streams

2002-10-08 Thread Larry Wall
: to be able to control what they do with their operands, and because new : types of array-like operands will have to tell operators how to treat : them. Blech. : : Well... no, not really. : : I think this vagueness is my fault, as I badger Larry and Damian : about it on occasion. Well, I'm never

Re: perl6 operator precedence table

2002-10-08 Thread Larry Wall
))) : : but I think the latter is unnatural enough that it deserves parens, so I'd : put 'but' above comma (and probably '='), but below just about everything : else. Could perhaps unify with C... Wouldn't hurt for it to be non-associative like C... : Larry mentions that other precedence unifications

Re: perl6 operator precedence table

2002-10-08 Thread Larry Wall
and :leftor xor err Those are fine. :-) Larry

Re: Fw: perl6 operator precedence table

2002-10-08 Thread Larry Wall
..] rather than a[0..Inf] But that's a special case. Larry

Re: perl6 operator precedence table

2002-10-09 Thread Larry Wall
On Wed, 9 Oct 2002, John Williams wrote: : On Tue, 8 Oct 2002, Larry Wall wrote: : : : but I think the latter is unnatural enough that it deserves parens, so I'd : : put 'but' above comma (and probably '='), but below just about everything : : else. : : Could perhaps unify with C

Re: Fw: perl6 operator precedence table

2002-10-09 Thread Larry Wall
On Wed, 9 Oct 2002, Nicholas Clark wrote: : On Tue, Oct 08, 2002 at 06:07:09PM -0700, Larry Wall wrote: : There's this basic rule that says you can't have an operator for both binary : and postfix, since it's expecting an operator in either case, rather than a : term (which is how we recognize

Re: Fw: perl6 operator precedence table

2002-10-09 Thread Larry Wall
On Wed, 9 Oct 2002, Brad Hughes wrote: : Larry Wall wrote: : [...] : Maybe we should ... to mean and so on forever: : : a[0...; 0...:10; 0...:100] : : Except then we couldn't use it to mean what Ruby means by it, which : might be handier in real life. : : No more yada-yada-yada

Re: Interface lists (was Re: Interfaces)

2002-10-10 Thread Larry Wall
that is...is...is... isn't all that onerous. To which the only correct reply is, but...but...but... :-) Larry

Re: Interfaces

2002-10-10 Thread Larry Wall
. Larry

Re: Interfaces

2002-10-10 Thread Larry Wall
$car.cd.eject() is all that horrible to contemplate. Larry

Re: remote generators and a macro language proposal

2002-10-10 Thread Larry Wall
) } 'Course, this might be more readable: for Subscribers { .send($ciggie_ad) if .smoker and .age 18; } Most smokers don't know what grep means, after all... Larry

Re: [ANNOUNCE] Perl6 OO Cookbook, v0.1

2002-10-10 Thread Larry Wall
with module MyModule;. That is, we discourage people from writing { class MyClass; ... } when they mean class MyClass { ... } Larry

Re: Delegation syntax

2002-10-10 Thread Larry Wall
the *implementation* syntax that should be screwed around with to do delegation. Something like: method steer is really(Wheel) is also(???) { .profit!!! } I guess now we need C??? and C!!! tokens now to go with C :::---))) Larry

Re: perl6 operator precedence table

2002-10-11 Thread Larry Wall
On Fri, 11 Oct 2002, Jonathan Scott Duff wrote: : On Fri, Oct 11, 2002 at 03:21:38PM +0100, Aaron Crane wrote: : Vaguely heretical, I know, but I'd be inclined to do something like this: : :Perl 5 Proposed Perl 6 :$x $y $x $y :$x || $y $x | $y : : Larry just added nice

Re: Private contracts?

2002-10-12 Thread Larry Wall
exception to that might be that the type declared on the variable is checked against the value's type at appropriate times. Larry

Re: Private contracts?

2002-10-12 Thread Larry Wall
On Sat, 5 Oct 2002, Allison Randal wrote: : use Acme::N-1_0; # or whatever the format of the name is I don't see why it couldn't just be: use Acme::1.0; After all, we don't have package names starting with numbers right now... Larry

Re: Interfaces

2002-10-12 Thread Larry Wall
On Fri, 11 Oct 2002, Michael Lazzaro wrote: : On Friday, October 11, 2002, at 04:11 PM, Larry Wall wrote: : has Nose $.snout; : has Ear .ears is cut(long); : has Leg .legs; : has Tail $.tail is cut(short); : : method Wag () {...} : } : : What's the rationale

RE: Private contracts?

2002-10-12 Thread Larry Wall
for a different purpose, and confusing the issue with DBC. Those are now FIRST and LAST, and the pre/post syntax is still undecided. Larry

Re: Private contracts?

2002-10-12 Thread Larry Wall
{ $that == $this / 2 } : { : # implementation goes here : } is post{ : # postcondition 1 : } is post{ : # postcondition 2 : } : : If you want an abstract method, just omit the implementation block. The absence of something is hard to notice. Put {...} for an abstract method. Larry

Re: Private contracts?

2002-10-12 Thread Larry Wall
On Thu, 3 Oct 2002, John Williams wrote: : On Thu, 3 Oct 2002, Trey Harris wrote: : : Incidentally, has there been any headway made on how you DO access : multiple classes with the same name, since Larry has (indirectly) promised : us that? I.e., I import two classes LinkedList and BTree

Re: Private contracts?

2002-10-12 Thread Larry Wall
the {...}. Larry

Re: perl6 operator precedence table

2002-10-12 Thread Larry Wall
On 11 Oct 2002, Simon Cozens wrote: : [EMAIL PROTECTED] (Larry Wall) writes: : I was thinking more along the lines of: : : $x $y : $x ||| $y : : This isn't Perl; this is merely some language that looks a bit like : it. I can understand the attraction for confusing anyone who comes

Re: Private contracts?

2002-10-12 Thread Larry Wall
. sub f(int $a) { $a is constrained($a=1,must be positive), documented(an integer); ... } f is constrained(some_global_condition), documented(applies transformation f to an integer); But maybe that's too weird. Larry

Re: perl6 operator precedence table

2002-10-12 Thread Larry Wall
if it really meant bits(any(1,2,4,8)) Larry, still thinking about a language vaguely resembling Perl 5. :-)

Re: Draft Proposal: Declaring Classwide Attributes

2002-10-13 Thread Larry Wall
is that the {...} of the class definition is really just a closure that executes once when the class is built.) Larry

Re: Private contracts?

2002-10-13 Thread Larry Wall
? I hope it's the former, but the : word subclass does usually imply inheritance Sorry, I meant a class named within the current package, not a derived class. Larry

Re: Draft Proposal: Declaring Classwide Attributes

2002-10-13 Thread Larry Wall
objects as well as create new ones. Perhaps they could be distinguished by the type of the invocant, if declared. Larry

Re: Private contracts?

2002-10-13 Thread Larry Wall
On Sat, 12 Oct 2002, Larry Wall wrote: : The precedence is screwed up though. It'd have to be : : use Acme[ (1;17..) | (2;0..) ]; Or maybe this: use Acme[1;17..] | Acme[2;0..]; That doesn't, of course, express any preference for one version over another, since | logically

Re: Private contracts?

2002-10-13 Thread Larry Wall
On Sat, 12 Oct 2002, Luke Palmer wrote: : Date: Sat, 12 Oct 2002 08:43:46 -0700 (PDT) : From: Larry Wall [EMAIL PROTECTED] : : If we use | and as sugar for any() and all(), then their precedence : should probably be the same as || and . : : Should they? I had in mind something just above

Re: Interfaces

2002-10-13 Thread Larry Wall
On Thu, 10 Oct 2002, Larry Wall wrote: : Anyway, I don't see offhand why composition can't simply be done with : attributes as it is in C++, especially since attributes manifest as : methods outside the class. I don't think $car.cd.eject() is all that : horrible to contemplate. By the way, ever

Re: Draft Proposal: Declaring Classwide Attributes

2002-10-13 Thread Larry Wall
like emphasizing the has/is distinction to help keep people from using inheritance when they should be using composition. At least, that's what I like this week... Larry

Re: perl6 operator precedence table

2002-10-13 Thread Larry Wall
the shorter of the two lists. Maybe... Just thinking... :-) Larry

Re: Interfaces

2002-10-13 Thread Larry Wall
On Fri, 11 Oct 2002, Larry Wall wrote: : You can certainly drop it within the methods, : since there's also the accessor methods. But I should point out that there's a semantic difference between $.foo and .foo, in that $.foo is guaranteed to get my copy of the attribute, while .foo might just

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