gt; >> the LAST time through a loop? etc.
>
>
> An exception is certainly a phase-change. Last time through a loop? Well,
> context anyway, if not phase, unless phase means "stage" in this instance.
> Hmm, I'm starting to talk like Larry. Bad John
ould be confused with use of : after the
invocant, and it follows that
:
: method bytes (Encoding :encoding($override_encoding)) returns Int
:
: would work.
Indeed.
Larry
and can do anything that you would expect from their lexical position.
All default expressions to any parameter are defined to run in the
context that assumes any parameters to their left are already bound,
so you may safely depend on self already being set.
Larry
typename, but I have it commented out
at the moment due to the fact that my current longest-token matcher
can't backtrack to an alternate choice. That is a temporary condition,
hopefully.
Larry
;
:
: If you call head(@foo), in the first $head gets @foo[0] and in the
: second it gets nothing (you didn't pass a scalar).
Nope, second one gets @foo as a scalar, and nothing in the list.
Larry
we make no
promises about supporting multiple dispatch on named args other than by
excluding candidates that can't bind at all.
Larry
ma is changing a built-in keyword, we usually name
it the same as the keyword, and we're claiming that a self pragma is
the right name for modifying "self". Or something like that.
Now that people have gotten used to self.foo and $.foo, it may be
that the demand for the pragma has fallen off a bit... :)
Larry
c chain it might be.
Yes, OUTER is necessarily always a particular lexical scope known at
compile time. Which is why we have CALLER for the other case. :)
Larry
On Sat, Apr 12, 2008 at 08:00:19PM -0500, John M. Dlugosz wrote:
> Larry Wall larry-at-wall.org |Perl 6| wrote:
>> What gives (in the sense of breaking) is the notion that you can do
>> multiple dispatch on randomly ordered arguments. That's the main
>> reason we inve
() in list context
always just disappears.
And 0,1 X () is going to be (). Perl 6's infix: is defined over
lists, not sets. If you want to overload X for set types, you may.
Larry
On Mon, Apr 14, 2008 at 06:28:06PM +0200, TSa wrote:
> HaloO,
>
> Larry Wall wrote:
>> No, the inner () is also in list context, and () in list context
>> always just disappears.
>>
>> And 0,1 X () is going to be (). Perl 6's infix: is defined over
>>
On Mon, Apr 14, 2008 at 11:47:04AM -0600, Doug McNutt wrote:
: At 09:58 -0700 4/14/08, Larry Wall wrote:
: >By the way, you don't need to put parens around the arguments to X. It takes
a list on either side. We made it tall so that it would stand out visually
anyway:
: >
: >$a
less efficient. Larry
and i have discussed this and that was his goai in Perl. Now Perl doesn't
quite meet that because of inferred method dispatch on .new(). you need to
change
:
: my Dog $spot = .new();
:
: to
:
: my $Spot = Dog.new();
:
: when you remove the declaration.
You
AND. The
user just writes an ordinary binary comparison that returns a boolean.
For several years now I've been treating any use of "but" as a code
smell, and changing the design so it isn't necessary. It's been a
rather useful construct that way, like "eval" and "BEGIN". :)
Larry
On Thu, Apr 17, 2008 at 09:24:47AM +0200, TSa wrote:
> HaloO,
>
> Larry Wall wrote:
>> On Wed, Apr 16, 2008 at 04:29:23PM +, [EMAIL PROTECTED] wrote:
>> : my Dog $spot = .new();
>> : : to
>> : : my $Spot = Dog.new();
>> : : when you remove the decla
binding as close
as reasonably possible, except that "my" parameters don't default
to readonly. They're more like ref parameters, I guess.
Larry
the same in
either case, except that if you declare the "of" type as Array, you
give the compiler/optimizer/type inferencer more information to work
with at compile time.
Larry
there without an identifier.
S02:1627
S06:883
S06:2119
S10:117
So I think (-->@) is fine as shorthand for returning something guaranteed to
provide the Positional role. (Those underlying sigil roles have long
names to discourage their explicit use, in any case. :)
Larry
n like loop and goto and die (and anything else considered
harmful but useful). But I don't see much use for it offhand.
Larry
Perl community. Then when someone like
you points out something related in the literature, it sometimes
happens that someone (usually someone other than me) will go off
somewhere and read some of it and report if there are some good ideas
to steal somehow. :)
Larry
pports it out the scope of the current class. Basically,
multi methods are just treated as multi subs inside a class, except
the invocant is predecided and doesn't make any difference to the
dispatch within the class.
Larry
bly enough non-meta operators
in standard Perl 6, and we shouldn't be looking for excuses to make
new ones for operations that will seldom make a difference in practice.
And Perl 6 thinks the difference between "09" and 9 is 0... :)
Topping all that is that the "09" behavior can be lazily explained
after the fact, while a new operator would have to be explained
beforehand.
Larry
s to be subsets. 'xxx' is just a Str that is
constrained to be equal to three x's. So please don't also try to
make subsets into real types, if you want to keep your types separate...
Larry
> It were interesting to know what $x.new returns. If that dispatches
> to Str
On Thu, Apr 24, 2008 at 08:10:12PM +0200, TSa wrote:
> HaloO,
>
> Larry Wall wrote:
>> On the other hand, "09" has the advantage of still having the numeric
>> value 9.
>
> Well, I think the canonical representation of of 9 is "9". The mapping
&
menting "10" or incrementing "-100". So I think
I'll probably reinstate the "looks like a number", at least for
integers in decimal notation. We've got to scan the string anyway
to look for the final alphanumeric string anyway, so seeing if it's
pure digits with optional '-' on the front would not be any more
inefficient.
Larry
iterator" }
> }
Erm, .length is dead, and .WHAT just smells that way.
given @foo {
when .elems > 5 { say "That's a long list" }
when .elems == Inf { say "That's a very long list" }
when Range { say "That's an iterator" }
}
Larry
uments.
You can also do it explicitly with a Capture declaration in the
signature and the prefix:<|> capture interpolator in an argument list..
However, &foo doesn't mean what it means in Perl 5. It's just the
function as a noun rather than a verb.
Larry
On Wed, Apr 30, 2008 at 07:29:58AM -0500, John M. Dlugosz wrote:
> I am listening. I'm synthesizing and documenting. I'm also disappointed
> with the lack of feedback from Larry, considering the amount of effort and
> time I'm putting into it. But I'm sure he
y nose runs and my feet smell. Quack.
Larry
uck, then you'd
better duck, because the person drawing the gun is probably not an artist.
Larry
On Fri, May 02, 2008 at 08:30:25AM -0500, John M. Dlugosz wrote:
> I agree. If typing is turned on, you want errors if you pass the wrong
> type. You have to explicitly declare that Bar is an acceptable substitute
> for Foo.
Maybe we already have this--see "emulates" in S11.
Larry
ntax at all.
If this is a proposal, I don't think it'll fly easily. Currently
sub foo ( Feline &f )
is shorthand for
sub foo ( &f:(-->Feline) )
Larry
subset mysub of Code where &mysub.sig;
sub mysubuser ( &f where mysub ) {...} # note &
sub mysubuser ( mysub $f ) {...} # note $
Larry
should version themselves so that the snapshots
can be distinguished by longname. Alternately, we make one snapshot
when a class is first composed, and refuse to make any other snapshots
for that name regardless of how the class under that name changes.
Larry
On Fri, May 02, 2008 at 12:21:27PM -0700, chromatic wrote:
: On Friday 02 May 2008 11:55:54 Larry Wall wrote:
: > The only interesting question in my mind is whether you can take
: > another snapshot and override the previous one somehow, or whether
: > such derived roles should version t
t.
:
: http://www.perlfoundation.org/perl6/index.cgi?perl_6_people
:
: I could edit it into a Synopsis if you really want.
Tweet! Foul on #17. Two shots!
Larry
>> run-time error where you might prefer DWIM.
>
> Perl 6 is the same, just at runtime with actual types of actual objects.
> That's it.
Indeed, Perl 6 threw out Manhattan distance a couple years ago. Do we
have to spec everything that Perl 6 ever was but isn't now? :)
Larry
the main reason we initialize with an undef of the correct sort
is so that you can say
my Dog $x .= new();
But what would (Dog|Cat).new() do? Constructors are not required to
know about subset types or roles. Constructors just create plain ordinary
classes, I expect. Composition and constraint checking happen
elsehwere.
Larry
On Tue, May 06, 2008 at 08:47:47PM -0500, John M. Dlugosz wrote:
> Larry Wall larry-at-wall.org |Perl 6| wrote:
>> On Tue, May 06, 2008 at 08:20:40PM +0200, TSa wrote:
>>
>>> HaloO,
>>>
>>> John M. Dlugosz wrote:
>>>
>>>>
ner, but of the value.
You'd have to say VAR($x).HOW to get the inner workings of the
container. Scalar containers always delegate to their contents. In
contrast, @x.HOW would be equivalent to VAR(@x).HOW, because composite
objects used as scalars assume you're talking about the container.
Larry
s that rw will cause autovivification and ref won't.
Larry
d that ref must already
>> be. But what is that supposed to mean?
>
>
> At a guess, "is rw" makes a parameter variable into a local read/write
> variable initialized with the parameter value. Changes to it are not
> reflected in the caller.
That would be "is copy"
Larry
before I start fleshing
> out the hierarchy for p5 autodie?
As chromatic suggested, it would be good to use some kind of role-ish
mixin idea (with or without Moose) instead of hierarchies of strings.
> * Is this an appropriate question for p6l?
I dunno--you're dragging us back down from the stratosphere of theory
to the troposphere of practice. I don't know if everyone here can
stand the shock. :)
> While it relates to a p5
> pragma, I hope to make the behaviour as compatible with p6 as possible.
Yes, I don't expect we can keep things entirely lined up, but it would
be nice to avoid gratuitous divergence if we can.
Larry
to inflict the maximum possible damage
on the enemy, which is our highest goal, after all. :)
Larry
On Sat, Jun 07, 2008 at 09:49:03PM +0100, Daniel Ruoso wrote:
: 2) Assume the capture-translation and define that
: $foo.HOW.can($foo,'bar') keeps the $how as the invocant and must receive
: the referring object as first argument.
I prefer this approach, I think.
Larry
)
:
: Ah, I should have been more specific - I meant that, since ~~ treats
: Ranges as continuous intervals, 0 ..^ 10 isn't the same as 0 .. 9.
: Although I guess there's no way to unabbreviate 0 ..^ 10...
Well, maybe 0 .. 10-ε or some such.
Larry
want to convert
the invocant to a particular type across the language as a whole.
No fallback is then necessary, and the fact that the Prelude is
defining language-wide default semantics is not a problem at all,
because that's precisely what the Prelude is for. And I don't see
any problem with the Any class claiming to own .join since subclasses
can still override if the like.
Larry
olve capture.
True, those are fossils.
Larry
things regarding type C that are type B's bailiwick.
On the other hand, transparency of code suffers under transitive
coercion, and the syntax above is no great hardship. Plus we could
always add something spectacularly explicit like
Int as (Rat.as)
if people decide they give one. ;)
Larry
loating-point.
We could go as far as to guarantee that Nums do rational arithmetic
out to a certain point, but probably what the financial insitutions
want is special fixed-point types that assume a divisor anyway.
Would any financial institution care to comment?
Larry
returns Int doesn't mean the compiler
has to represent 1 the same way it represents 42. But it wants to
look that way from the viewpoint of the programmer, who pines for an
occasional smattering of foolish consistency.
Larry
On Thu, Jun 26, 2008 at 09:46:25AM -0700, Larry Wall wrote:
: the VM somehow sneaks in the appropriate conversion for us if we
: actually try to pass an Int to a Rat.
I'd point out that this is fundamentally the same decision point that
is reached when we want to do boxing, because we basi
ormally does list-type operations.
:
: I'm suspecting that the answer is "yes, they are universal",
: but wanted to confirm it.
Confirmed. (Though note that Str.reverse probably overrides
Any.reverse, unless we give string reversal a different name.)
Larry
considered one of the parameters.
Larry
$^b }.assuming(:a(3));
Also, it may well be that f(3) will say Order::Same rather than 0. :)
Larry
in infix position always pick the most recent operator (that isn't
hidden inside brackets or parens).
Larry
er hand, a
naïve implementation of the multidimensional subscripter might just do
the same thing internally for the semicolon, so it could be a wash.
Larry
tions if we can assume them to be both sufficiently lazy and
sufficiently intelligent... :)
Larry
d automatically yield the scalar
: multiplication infix:<+*>:(Vector,Num) when infix:<+>:(Vector,Vector) is
: defined as expected.
You can, of course, do anything you like with your own copy, but the
standard reserves most of Unicode as the playground of mathematicians,
so please leave our poor little * alone. :)
Larry
It seems like my smiley went completely whoosh...
Larry
er and S06 is out of date here. Is that
> correct? I'll make proposed edits to the file to send back to the
> maintainer, once I know which way is correct.
Yes, that is correct--"returns" used to be the way to specify "as" type,
but we introduced "as" for that and now "returns" is synonymous with
"of".
Larry
cal scope of the statement, but a temp would
presumably not. But arguably the proper thing would be to outlaw
lexically scoped declarations entirely in such a conditional thunk,
akin to the P5.10 restriction on
my $x = 1 if 0;
Larry
value outward. I guess that'd work.
As for temporizing the results of code execution, that probably will
have to wait on a coherent transactional memory model, which may or may
not be deferred till after 6.0.0, but my bets are on "may" at this
point. :)
Larry
memoized based on the
typeshape of the Capture, it will generally not have to be redone
until you see a different typeshape (where the meaning of "different"
may depend on how specific the signatures are, and in particular on
whether any of the signatures rely on subset constraints (including
individual values, which are just degenerate subsets)).
Larry
candidate for a null name:
sub () is foo {...}
is of course not possible. I suppose we could nudge things in a
direction that
sub & is foo {...}
would work, since that'd be much like
state $ = do { "I am a fake START block" }
But if we allow "sub &foo" then people will wonder what "sub @foo" means...
Larry
d a statement as an argument, where currently you could write
try $x if $y;
But staring at those two, I'd say the parens are almost a feature from
the least surprise viewpoint.
Larry
nteed not to work. I can't imagine why anyone would want
a ",:foo" operator, for instance. Doubtless there are other confusing
operators though.
Alternately, we could force everyone to put space after comma. :)
Larry
ot. But I
think that's kinda tacky, and your example still would not work unless
you changed it to [lt:lc].
There comes a point at which it's just better to force the user to say:
my &infix: ::= &infix:.assuming(:lc);
[lt_lc] $a, $b, $c;
Larry
On Fri, Aug 08, 2008 at 10:34:50AM -0700, [EMAIL PROTECTED] wrote:
: Author: larry
: Date: Fri Aug 8 10:34:49 2008
: New Revision: 14574
:
: Modified:
:doc/trunk/design/syn/S02.pod
:
: Log:
: allow isolated ' and - in identifiers (only if followed by alpha)
Darn the syntax highli
like:
rand*100
100.rand
(1..100).pick
And, in fact, if you say "rand 100" the current STD grammar complains:
Obsolete use of rand(N); in Perl 6 please use N.rand or (1..N).pick instead
Larry
ference, if you will) by default.
It's quite possible this is insane, but I can't tell in my current
state of jet lag.
Larry
he apostrophe rule
in the standard grammar, so I'm not going to go out of my way to add
maximum flexibility to the base grammar. Currently the apostrophe
rule reads:
token apostrophe {
<[ ' \- ]>
}
Larry
#x27;re trying
to cheat on the scalar parameters somehow. It's not needed in list
context.
Larry
left, but not on the right.
Interestingly, ?& and ?| collapse both sides because they coerce both
sides to boolean. Either that, or we make neither side collapse,
if someone can come up with a use case for junctional booleans,
though I suspect the same purpose can be served by +& and +| if you're
careful only to feed it 1 or 0. So probably conceptual consistency
is better here.
Larry
On Sun, Aug 24, 2008 at 05:05:46PM -0500, Patrick R. Michaud wrote:
: On Sun, Aug 24, 2008 at 03:00:54PM -0700, Larry Wall wrote:
: > : Question to p6l: do && and || autothread? Or do they collapse the
: > : junction prior to evaluation? (I hope the latter, since I think it'
o that, but until
someone invents a quantum computer that can lift monads, we have to
worry about side effects sooner or later... :)
Larry
#x27;s more to it than that. Politically, it's a kind
of compromise between p5p and me. I hated their "dor" operator,
and p5p by and large hated the "err" operator. The result was that
we switched to "orelse" and they dropped "dor". So the preceding
paragraph can be construed as a mere rationalization of why the
sausage came out of the sausage factor green this time. :)
Larry
On Mon, Sep 01, 2008 at 03:40:39PM -0400, Brandon S. Allbery KF8NH wrote:
> On 2008 Sep 1, at 15:20, Larry Wall wrote:
>> On Mon, Sep 01, 2008 at 05:52:28PM +0200, TSa wrote:
>>> John M. Dlugosz wrote:
>>>> Perhaps the supplier of the CPAN module for the nth fu
orelse
d() orelse
e();
CATCH {
when MajorMalfunction { die "oopsie" }
}
assuming that exceptions somehow get returned or thrown appropriately.
I suppose orelse could itself throw any exception that it doesn't want
to treat as benign, and the CATCH block would handle it. And the
definition of "benign" could then be pragmatically controlled if the
default wasn't good enough, I suppose.
Larry
On Wed, Sep 03, 2008 at 06:41:10PM -0500, John M. Dlugosz wrote:
> Larry Wall larry-at-wall.org |Perl 6| wrote:
>> a() orelse b()
>>
>> you might want to:
>> succeed on a()
>> trap mild failure of a() and try to succeed on b() instead
>>
other words, it sets $/ just like the normal ~~ operator, but
the boolean sense comes out backwards:
if $a !~~ /foo/ {
# $/ is false
}
else {
# $/ is true
}
Larry
mere "{...}"
or "..." on the assumption that you don't actually have to test for
the default condition. Which you don't, but it should still run
only one default block, so it should really turn into something like
"{...; break}".
Larry
ace.
By the way, I'd like to see a user interface where the outer exception
is the one printed out in simple form, with the complete "cockpit
recorder" dump of information going into a file that is browser
accessible with a click on a link in the error message to "more info".
Larry
failure in item context. Possibly the right side of
a pair should be capture context rather than item context. Not sure
about that...
Larry
nstraints,
> such as whether it can be multi-threaded or merely delayed 'till needed.
I think you're looking for "hyper" here, which implies unordered
execution (but still with ordered results). If you really want
unordered results you'd have to do something like a gather containing
a hyper containing a take.
Larry
seems to me like the most multicore-friendly default, though
perhaps not the most programmer friendly. It seems to me that any
programming involving cyclic lazy feeds must somehow have an "eager"
in it somewhere to prevent indeterminacy, but I don't know how to
write a compiler that enforces that offhand.
Larry
On Tue, Sep 09, 2008 at 08:50:02AM -0700, Larry Wall wrote:
: At the moment the design of Perl 6 (unlike certain FP languages) is
: that any dependence on the *degree* of laziness is erroneous, except
: insofar as infinite lists must have *some* degree of laziness in order
: not to use up all your
rrently considered a terminator that doesn't
distinguish between expression termination and statement termination),
but I'm not sure how to fix it yet. It's possible that statement
modifiers should be demoted to very-low-precedence operators, but there
are some problems with that that I don't have enough brain to think
through at the moment.
Larry
s orthogonal
to the actual class boundary, if you ignore the fact that we prohibit
$!foo access from outside the class. (And, in fact, we could probably
still get at it with a private method from outside the class if there
is an appropriate "trusts" declaration.)
Larry
rify what the behavior should be?
S05 is using a different definition of "match". In S05 it means
more like "one low-level run of the regex engine" rather than "one
high-level call to the .match method". In other words, the .match
method can do multiple matches.
Larry
rn the null strings before or after 'a', just ('a').
Larry
ed "Int". A native "int" is another matter, but that's just
a storage constraint, and probably shouldn't influence intermediate
computations, which are done in Int. So it shouldn't matter whether 2
and 1100 are stored in Int or int form; the result should be the same
(subject, perhaps to pragmatic control of temp types).
Larry
iven away some of those value
via an iterator.
Here's a cute variant that doesn't have to store all the values just
to keep count:
1 ... { $_ + 1 if ++(state $) < 10 }
Hmm, I think *my* state's $ will soon be less than 10, at the rate
they're spending... :)
Larry
On Sun, Oct 05, 2008 at 07:31:30PM -0700, Larry Wall wrote:
: @seq := 1 ... { $_ + 1 if @seq < 10 }
Actually, that one might not work, since we can't find the length of
@seq without knowing how many value the closure will generate. The
implicit version would not have that problem.
Larry
e tools to do this sort of thing explicitly instead of
: having to rely on the optimizer to know how to do this implicitly.
Um, I don't understand what you're asking for. Explicit solutions
are always available...
Larry
On Mon, Oct 06, 2008 at 09:09:55AM -0700, Jon Lang wrote:
: Larry Wall wrote:
: > On Sun, Oct 05, 2008 at 08:19:42PM -0700, Jon Lang wrote:
: > : <[EMAIL PROTECTED]> wrote:
: > : > Log:
: > : > Add missing series operator, mostly for readability.
: > :
: > : Is
s,
but may intermediate linearizations are possible. Don't want to
get stuck into binary thinking here...
Larry
with the "fate" system of STD it
might even be relatively easy to put the parser back into a state
that was deeply recursive and restart the parse at any point.
'Course, "relatively easy" is one o' them relative concepts... :)
Larry
-right evaluation of additional constraints.
Larry
on $othernode, so that I could ensure that
> they belong to the same tree, for example. Is there a way I can do that?
You have to write your own wrapper methods for that. Delegation does
not mix well with micromanagement. :)
Larry
1501 - 1600 of 3168 matches
Mail list logo