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
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
this:
Perl 5 Perl 6
{1,3} 1..3
{3} 3
{3,}3+
{0,3} 3-
Then again, maybe not...
Larry
in the general re-huffmanization of regexen.
Larry
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
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
= div.with(y = 2);
Larry
curry? And is that red, yellow, or green curry?
Larry
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
. 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
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
control structure using nothing but closures. We could also
change Perl's syntax to use nothing but parens, but we're not gonna. :-)
Larry
We've pretty much settled on div.prebind(y = 2) as the most informative and
least conflictive.
Larry
people can't leap tall
buildings in a single bound.
Larry
.
Larry
. 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
? 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
to
be replaced by !metachar+
Nope, still gotta use [foo] if you want an atom larger than a character
(whatever a character is...)
Larry
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
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
,
it returns undef.
Larry
. 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
) 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
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
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
, 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
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
;
}
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
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
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
. '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
, slurp,
rather than automatically concatenating all the files.
for slurp - $file { ... }
Larry
:
incr := add.assuming(x = 1);
Larry
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
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
a pointy sub might be
expected.)
Larry
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
having to name it. That lets you write
anonymous recursive rules, or possibly a generic rule that could
have more than one name.
Larry
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
circles.
Larry
such hypotheticals into.
Larry
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
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
. 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
are exceeded. Even in language we often
have to reparse sentences that are garden pathological. Why should
computers be exempt? :-)
Larry
).
Larry
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
the constructor
isn't going to change.
Again, though, assignment to a normal variable is unlikely to invoke
a constructor in any case.
Larry
as a single args argument without having to play with splat.
Larry
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
the ball into the hole.
And I'm happy if the ball ends up closer to the hole than it was.
Larry
+ }
:rule bar { a foo b }
Yes, it must. It's only rules embedded in closures that are exempt
by default, I think.
Larry
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
will make a ref in Perl 6:
$arrayref = (1,2,3);
Larry
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
) is given($x) {...}
Larry
programmer would think.
(In Perl 6 it's the length of the anonymous array, not the last value.)
Larry
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
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
//=
seems to imply otherwise. And //= is too visually disruptive to the
signature.
Larry
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
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
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
= { 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
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
could easily have used a
special token like NULLLIST instead. What does INTERCAL use?
Larry
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
: 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
)))
:
: 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
and
:leftor xor err
Those are fine. :-)
Larry
..]
rather than
a[0..Inf]
But that's a special case.
Larry
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
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
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
that is...is...is... isn't all that onerous.
To which the only correct reply is, but...but...but... :-)
Larry
.
Larry
$car.cd.eject() is all that
horrible to contemplate.
Larry
)
}
'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
with module MyModule;. That is, we discourage
people from writing
{
class MyClass;
...
}
when they mean
class MyClass {
...
}
Larry
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
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
exception to that might be that the type declared on the variable
is checked against the value's type at appropriate times.
Larry
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
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
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
{ $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
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
the {...}.
Larry
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
.
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
if it really meant
bits(any(1,2,4,8))
Larry, still thinking about a language vaguely resembling Perl 5. :-)
is that the {...} of the class definition is really just
a closure that executes once when the class is built.)
Larry
? 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
objects as well as create new ones. Perhaps they
could be distinguished by the type of the invocant, if declared.
Larry
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
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
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
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
the shorter of the two lists.
Maybe...
Just thinking... :-)
Larry
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
801 - 900 of 2908 matches
Mail list logo