o get exceptions not to happen at all. Normal junctions don't
trap exceptions either, but also can't guarantee order of evaluation.
This variant does. That's all.
Larry
x27;s possible there could be a built-in function:
if($condition, {$true}, {$false})
The lazy short-circuit nature would be explicit there via the closure
args. I suppose one could specially implement a statement_control:
macro though, as in the ??!! case.
Similar considerations would apply for functional/macro forms of && and ||.
Larry
method .junk is defined in Junction, you can still force it to
autothread by saying $junction.Object::junk().
Larry
r "casting" method of choice is for turning
a string into an object with the correct methods. Somehow I think
.filename is a bit too long, huffmanwise.
Larry
> I agree as well, but make a different proposal how to resolve it.
> BTW, how does an empty junction work? That could happen not only
> with one() but also through one(1,2,1,2) in my proposal. So one()
> is just another way of writing False ;)
It seems simpler to say that one() produces bags rather than sets.
Larry
you really
want to compare the contents of two junctions, you have to use the
results of some magical .eigenmumble method to return the contents
as a non-junction. Possibly stringification will be sufficient, if
it canonicalizes the output order.
Larry
We could fix it two ways. Either the mainline code
gets a consistent new name, or the outermost scope is redefined to an INIT
if there is a user-defined MAIN. I can argue it both ways.
Larry
ith
document "owners".) Currently, it's called IO.pod, but it'll probably
end up somewhere else in the dir structure with a more S16-io-ish name.
Larry
On Fri, Nov 21, 2008 at 09:57:30AM -0800, dpuu wrote:
: On Nov 21, 9:16 am, [EMAIL PROTECTED] (Larry Wall) wrote:
: > Please feel free to whack on the spec
:
: OK, working on it.
:
: Question: is it appropriate to P6 look&feel to have methods on
: functions?
:
: The definition of C inclu
=> :!x)
:# same as 'chmod o-x $file'
A pair on the left side of => could be construed as a design smell.
And I wonder if the set/modify distinction can be better mapped onto
assignops somehow...
Larry
On Fri, Nov 21, 2008 at 09:42:41AM +0100, TSa wrote:
> HaloO,
>
> Carl Mäsak wrote:
>> I expected this to DWIM today:
>>
>> $ perl6 -e 'my $cl = { "$^name upcased becomes {$^name.uc}" }; say
>> $cl("larry")'
>>
>> ...but
turn @*ARGS into a single abstract file handle.
Larry
net.
Larry
nt Parrot meaning, and
[X] ^«(3,3)
or
^3 X ^3
to get the specced list meaning. But other viewpoints are welcome...
Larry
ch Any and have string coercions.
Outside of Any are the Object and Junction types; I suppose cmp can
thread on junctions, but trying to sort junctions might well result
in aberrant behavior, especially if we choose a sort algorithm that
coredumps on circular ordering relations. :)
Larry
st that not the index of the last
: > element is returned, but the element itself. (Which I think is pretty weird)
:
: I've found a test that seems to imply that the index is meant, so I've
: patched S29 to say that.
Yes, that is correct.
Larry
with stringification. In general I think that a pair should
> hide its key as far as possible if used as non-pair.
This makes sense to me, but I'd like to see any use cases to the
contrary, if anyone can think of one.
Larry
found in:
http://svn.pugscode.org/pugs/docs/Perl6/Spec/S29-functions.pod
Larry
hash would print,
> right?).
Nope, would print "a\t23\n" as currently specced.
Larry
atch &?ROUTINE, so the outward
search for a handler terminates at that point. Doing it the other way
would make it impossible to optimize return into a goto end-of-routine.
Unlike warn, return is normal control flow, and we need to be careful
not to mandate largely useless overhead.
Larry
#x27;, or 'redo' exception to some outer loop, or maybe enter some
kind of safe mode, if it's a spacecraft. So I think the exception
handlers have to be trusted to make the final determination of how
to handle exceptions, which seems reasonable. Engineers who write
bad exception handlers will lose control of their work.
Larry
I think I'm fine with making them separate. Recursive lazy flattening
seems too evil; slice and list contexts should not try to do the work of
captures. Thanks.
Larry
. The policy
(shared with Perl 5) is that you may use goto into any loop that
doesn't depend on an initializer. It's illegal to go into
a for 1..10 loop, for instance, since the loop won't be initialized
correctly.
Larry
to the caller Routine?
Which is most easily expressed as:
&somesub.leave()
or
caller.leave()
if you want it anonymous.
But 'return' is shorter than that, and lambdas are shorter than
routine definitions, so the only reason for not using return
is if you want to define your helper block outside of the scope
in which return would work.
Larry
like you'd see such values so
often that the extra indication of unusualness would be unwelcome.
Larry
then, so I'd say it's a buglet.
Larry
e when the binding stops.
Well, my brain feels like it's in sideways today, so I'd better stop
before I say something profound but wrong...
Larry
On Wed, Dec 31, 2008 at 08:06:48AM -0800, Ovid wrote:
: Just stumbled across this, but I can't tell from S09 if this is a bug or
feature:
:
: $ ./perl6 -e 'my %foo; if %foo {}; say %foo.perl'
: {"a" => undef}
Definitely bug. Rvalues aren't supposed to autovivify.
Larry
r even single-use continuations in the
minds of mere mortals. Using bare continuations where gather/take or
closures will do is like throwing out your steak knives because they
duplicate the functionality of your chain saw. :)
Larry
oo ~ ">"'
:
: $ perl6 -e 'my $foo = "foo";say "{" ~ $foo ~ "}"'
:~ foo ~
Yep, that's working right. Or at least, working as designed... :)
Larry
ike the negated options though. They smell funny.
Larry
#x27;t see much need for alternate
trimmings.
Larry
should be the destructive version.
Larry
uble quotes when you want to interpolate. :)
: >
: > This is not really an option when running 'perl6 -e' under bash, though.
:
: $ perl6 -e 'my $foo = "foo";say q:qq({" ~ $foo ~ "})'
:
: ...or something to that effect.
Assuming that's what was wanted. I figgered they want something more
like:
$ perl6 -e 'my $foo = "foo"; say q[{] ~ $foo ~ q[}];'
Larry
unt braces.
But the P6 parser has sworn off all such activities for P6-derived
code. Parsing something first as a string and then again as some
other language is generally looked upon as a Bad Plan these days.
Which is, of course, why "{" is a problem now. Perhaps use of nested
double quotes deserves a warning.
Larry
ffers from
: an existing class only in terms of version information, such that it
: is substituted for the original class within the lexical scope where
: it was defined, barring explicit inclusion of version information when
: the class is referenced.
That is the preferred way to avoid action-at-a-distance in P6.
Larry
7; on arrays, but it's a no-op. Similar issues
with chomp and friends.
It should probably say "No such method". We have hyperops now to apply
scalar operators to composite values explicitly:
@array».=trim
Larry
On Mon, Jan 12, 2009 at 06:36:55PM +0100, Moritz Lenz wrote:
: Carl Mäsak wrote:
: > Jonathan (>), Ovid (>>), Larry (>>>):
: >>>> Can't say I really like the negated options though. They smell funny.
: >>>
: >>> Agreed, but ltri
nge gracefully
over time if we get this part right. The current lexical context
determines the types that are visible, as well as the multimethods
that are visible on those types, including the operations used to
parse and mutute the language itself. Seems simple enough... :)
Larry
ifferent versions, at some point you end up re-inventing version
control merges for object attributes, and then you're probably
just hosed.
Or you just call it a "sync" and pretend it's no problem. :)
Larry
lass protoobject within
the class closure but outside of method declarations, we can
probably get it to work like you expect, presuming you don't run into
order-of-initialization issues. And running the block should probably
be the final operation in class initialization, or very close to it.
Larry
llide with user-defined adverbs.
Maybe something in all caps. For what it's worth, :OK<> can be typed
with one hand while the other holds down the shift key. :)
Larry
requested to do so.
My main concern is that the fudging directives not be intermixed with
the actual test, and that they not look like real code.
Larry
st code that
asserts failure a priori can never prove success. We must keep a clean
separation between code that proves success and any indicator that says
"don't try this yet". Every bit of code that is dependent on platform
dependencies is, by definition, not platform independent, and we've got
to keep at least the language validation tests platform independent.
Larry
ny reason to
disallow it, and it can always be used to document that a scalar must
contain a code object of some sort.
Larry
arg binds to @a in every case.
Larry
f ...
}
}
If you tell me that another language does something a particular way,
I'll take it as a possible recommendation maybe 10% of the time,
and as a dire warning the other 90% of the time. :)
Larry
hat has :bool...
> ?? Is this just "belt and suspenders" checking, or can that meta op
> apply to more?
The intent is that if the user defines a new precedence level, it
may have :bool set, and the corresponding metaops will be autogenerated.
Arguably it should not depend on a :bool flag but on the actual return
type of the operator. (Also arguably, there should be a - metoperator
to apply to anything returning the Order type, such as cmp, leg, and <=>.)
But we don't really have a way of declaring that yet, so we probably
need to at least generalize :bool into :returns(Bool) or some such.
Larry
n, the
: fact that C<=> isn't a comparison operator?
It would be a tie, since both operators are the same length. The
current tiebreaking rules would make it depend on which was declared
first, which may or may not make sense. Arguably autogenerated
operators should give way to hardwired ones, much like foo\w* gives way
to foobar currently.
Larry
On Tue, Jan 27, 2009 at 11:56:16AM -0800, Larry Wall wrote:
: Arguably autogenerated operators should give way to hardwired ones,
: much like foo\w* gives way to foobar currently.
Though I should point out that this wouldn't help with -=, since it's
autogenerated either way, unless you
e disallowed because you can't use recursive
patterns in the LTM if it is to remain in the realm of regular
languages. [X>>+< Lastly, the token for [x] (prefix_circumfix_meta_operator.reduce) has an
> oddity that it allows an optional trailing << (acutally, only the
> Unicode version of that!). I'm not sure why the prefix hyper metaop is
> parsed here... especially since the code for token PRE clearly parses
> this construction.
Again has to do with faking out the LTM pattern generator for now. Should
get better later.
Larry
ess ...
$a R= $b === $b = $a
There is, after all, precedent with X...X.
Hmm, I suppose an argument could be made for simplifying meta-cross
to just X...
@a X~ @b
@a X* @b
...
Trying to think of the downsides, and having trouble...
Larry
return a
> type that is compatible with being on its left side for a given type on
> its right. There are things that are currently allowed here, like [:=]
> or [=>] that may not make much sense. Perhaps there should be :reduce
> like there is :assign to indicate which are
Or the veto forms of that, as we discussed on irc. Anyway, not really
trying to restrict the freedom of people to shoot themselves in the
foot so much as just hoping to be able to warn them why their foot is
about to go missing with a reasonable error message when something
is obviously misthought. And I obviously ought to go to bed before
I write much more stream-of-unconsciousness prose...
Larry
On Fri, Jan 30, 2009 at 10:49:13AM +0100, Carl Mäsak wrote:
: Mark (>), Moritz (>>), Larry via commit bot (>>>):
: >>> +PERL# Lexical symbols in the standard "perlude"
: >>
: >> Did you mean "prelude" instead?
:
t; I thought NFC sort of did one codepoint per grapheme but there were a few
> exceptions ... I could be wrong on that point.
You are correct, NFC doesn't do all that we want.
By the way, we could use someone to write the Perl 6 Unicode synopsis,
based on PDD 28.
Larry
: > not have to be C -- any unrecognized format name will do
:
: I believe that with this change in wording the next line needs to use
: 'to delimit' rather than just 'delimit'.
You've got a commit bit, I believe. :)
Larry
in?
> This is a goofy idea, drop it?
Seems fine, and I think I like the simplicity; go ahead and check it
in unless someone can spot a difficulty. We can always fix anything
that goes haywire, or split one of the categories again if necessary.
Larry
roke. Which
is not what getc was originally intended for, in any case, since it
lives on top of stdio and usually just means take the next character
from the input buffer.
Larry
On Mon, Feb 02, 2009 at 07:47:33PM -0300, Daniel Ruoso wrote:
: Em Seg, 2009-02-02 às 09:37 -0800, Larry Wall escreveu:
: > It's also not clear how this should interact with buffering systems
: > like stdio. But in any case, speaking directly to the IO stack is
: > likelier to g
>> as
>>
>> Should the default pattern be ' ', or should it be something more like /\s+/?
>
> // ?
You guys are all doing P5Think. The default should be autocomb, not autosplit,
and the default comb is already correct...
Larry
On Thu, Feb 05, 2009 at 10:43:35AM -0800, Jon Lang wrote:
: On Thu, Feb 5, 2009 at 9:21 AM, Larry Wall wrote:
: > On Thu, Feb 05, 2009 at 07:47:01AM -0800, Dave Whipp wrote:
: >> Jon Lang wrote:
: >>>> Pattern to split on (used with -a). Substitutes an expression for the
warn on -a -F ':' and ignore the -a.
Hmm, though if ':' is a pattern it's an illegal pattern...would
need to be '\:' or some such...
Larry
longer the fourth metaoperator (as stated in the first
: sentence of the reduction operators section). For now, the cross
: operator _is_ still the final metaoperator, as it states in its first
: paragraph; but it's possible that that might change eventually.
Indeed. Thanks.
Larry
on feather.perl6.nl,
for instance.
Larry
e the only definition, and you'll
get a warning on a second explicit definition. With the A::Foo form,
we can infer that there is an A package that may or may not have been
explicitly defined yet, but it produces no warning if an explicit
definition is subsequently seen. (This is described in my recent
update to S10 a day or so ago.)
Larry
ess
at the point it sees the name, which is when it wants to stick A into
the symbol table. Whereas "is also" has to operate retroactively on
the name.
This also lets us mark a package as explicitly monkeyable by design,
in which case there's no need for a MONKEY_PATCHING declaration.
That being said, the CORE packages will not be marked multi. :)
Larry
u
must do it with something like:
proto class Int is MONKEY_PATCHING(CORE::Int) {...}
multi class Int {
method Str () { self.fmt("%g") }
}
or some such monkey business.
Larry
signatures (and perhaps captures, given the
: intimate connection between these two), since its original purpose
: (i.e., references) has been deprecated.
That has been the intent, though nobody's got around to doing it.
Larry
own at compile time, which $? implies. $? variables have to be
constants known at compile time.)
Larry
native seconds shouldn't be varying in length. And I
also think with the advent of ubiquitous GPS we're getting to the
point where nearly all computers will know the correct atomic time.
Time is on our side, as it were...
Larry
ed in the OS is simply being annoying.
Perl 6 will have a type system, unlike C.
Larry
s calculated with the same
datatype for normal time. No discontinuities allowed, though of
course precision is going to be relative. That's construed as a
feature.
Larry
m to keep the
units straight. I'm also interested in killing the POSIX concept of
time as soon as possible, at least as the default view of reality.
By the by, I'm also inclined to agree with those who prefer "Instant"
to "DateTime" on aesthetic grounds.
Larry
as possible to feed the optimizer.
So fallbacks are not in vogue these days.
Larry
On Fri, Feb 20, 2009 at 03:31:03PM -0300, Daniel Ruoso wrote:
: Em Sex, 2009-02-20 às 10:17 -0800, Larry Wall escreveu:
: > By the by, I'm also inclined to agree with those who prefer "Instant"
: > to "DateTime" on aesthetic grounds.
:
: I should note that I'
ck the one that's easiest on the software (time_t) and leave the
: transformations to the libraries.
time_t must die. This is non-negotiable.
Larry
to integers apart from cultural artifacts.
Let's keep our integers in the libraries, not in the fundamental
definition of what "now" and "then" mean.
Larry
e could go so far as to say that the default is that all
unclaimed events turn into resumable exceptions by default, and are
simply discarded if no handlers exist in the dynamic scope.
Larry
se Num :precision(0);# force exact matches in this block
Or just:
if $x ~~ $y ± $epsilon {...}
where infix:<±> turns the single value into a range for the smartmatch.
Larry
ullet lists into a real outline while you're at it,
feel free. :)
Larry
if you declare has $brain,
which apparently I hasn't. :)
Larry
o clamp 100..200;
take $bar clamp $midpoint ± $epsilon;
Larry
On Mon, Feb 23, 2009 at 11:54:44PM -0600, Chris Dolan wrote:
> On Feb 23, 2009, at 11:16 PM, Larry Wall wrote:
>
>> if $x ~~ $y ± $epsilon {...}
>>
>> where infix:<±> turns the single value into a range for the
>> smartmatch.
>
>
> That's ve
xplicit placeholder, not by leaving things out. (Of course,
this is a requirement in Perl anyway because its parser depends
heavily on term/infix alternation.)
Larry
te-tomorrow
:
: even if $time falls precisely on midnight.
Half-open, certainly, so really same as ($y - 5) ..^ ($y + 5).
Larry
;
>>has ElementType @.contents;
>>method circumflex:? [ ] ? (int $index where { $_ >= $MinIndex } ) {
>> return @.contents[$index - $MinIndex];
>>}
>> }
>
> Good idea. That retains the functionality, but without us having to
> spec it :).
Oops, too late, by about 23 months. Please see S09.
Larry
way would be to define ± as
simple half-open Range and then overload comparison:
multi sub infix:<==>(Num $x,Range $r) {
$x == any($r.minmax);
}
Of course, that would potentially introduce a failure mode where
people say == when they mean ~~, or vice versa. Maybe that wouldn't
be a big problem in practice.
Larry
standard containers. I don't see any great
motivation for that offhand, but we'll have to examine the use cases
as things progress.
Larry
nning through some of the more enlightened literature of missiology.
As we were told in our training with Wycliffe, "Your job is *not*
to go out and build a little white church with a steeple."
Given the influence of linguistics and anthropology on Perl, your
cultural metaphor is not just an accidental resemblance. :)
Larry
on, rather than relying on foo() to do both multiple dispatch
and low-level invocation. Or maybe we just define .() to mean that,
and make ()/.() inconsistent with other dotless/dotty postfixes.
Larry
) adds the method
into Any after the fact. Not exactly sure when "the fact" is, though. :)
So as usual, we can argue it both ways, and maybe a third or fourth
if we're lucky...
Larry
logic error
in the program, and an earlier message is better, even at the expense
of thowing away some (possibly valid) partial data. Especially since
we do have a way to indicate that partial data is acceptable:
-> $a, $b?, $c? { $a + ($b//0) + ($c//0) }
Larry
On Sun, Mar 08, 2009 at 09:43:17AM +0100, pugs-comm...@feather.perl6.nl wrote:
: added new rule to enable definition of .
is bad design, because people will think it matches a whole word,
and it's unnecessary because it duplicates \w.
Larry
mmediately followed by an
: alphabetic character. Otherwise they're not part of the
: identifier. (At least, that's how the current STD.pm reads.)
That's correct, we can ignore ' and - for that purpose.
Larry
On Mon, Mar 09, 2009 at 02:40:43PM -0300, Daniel Ruoso wrote:
: Em Dom, 2009-03-08 às 21:31 -0700, Larry Wall escreveu:
: > I think the basic rule has to be simply can the signature bind to
: > the remaining arguments. If not, we get a warning on unused arguments.
:
: Just to put here an
On Mon, Mar 09, 2009 at 11:38:29AM -0500, Patrick R. Michaud wrote:
: On Sun, Mar 08, 2009 at 09:31:19PM -0700, Larry Wall wrote:
: > On Sun, Mar 08, 2009 at 09:36:17PM +0100, Moritz Lenz wrote:
: > : But both pugs and rakudo respect the arity of the code ref passed to it,
: > : so that (
hat is the signature of &square_list ?
Just (*...@list) or some such.
Larry
end, I picked . because it looks fairly distinctive in normal
code, and kinda asks, "Well, what is it really?" But it's not writ in
stone yet.
Larry
$y = Role::Serializable::YAML($resultset);
Larry
On Thu, Mar 12, 2009 at 03:05:17PM -0300, Daniel Ruoso wrote:
: Em Qui, 2009-03-12 às 10:28 -0700, Larry Wall escreveu:
: > On Thu, Mar 12, 2009 at 08:51:45AM -0700, Ovid wrote:
: > : > From: David Green
: > : > I suppose, but is there a reason why you want to apply roles inste
1601 - 1700 of 3168 matches
Mail list logo