at deal of implied laziness (and associated potential
grief if done poorly). There's much to be said for a pragma that
forces the issue: "Just gimme my Rats, darn it!"
But I'm also still wondering whether a simpler approach is to declare
that Num is a role that can encapsulate objects of class Int, Num,
Rat, or Dec as necessary. There also a lot to be said for simple...
Larry
On Tue, Jan 02, 2007 at 09:24:20AM -0800, Larry Wall wrote:
: But I'm also still wondering whether a simpler approach is to declare
: that Num is a role that can encapsulate objects of class Int, Num,
: Rat, or Dec as necessary. There also a lot to be said for simple...
Well, that
gers or scaled floating point, as long as you get 15 digits
altogether, 3 exact digits after the decimal point, and it's fast. :)
Larry
tiate to make a direct
conversion and bypass the canonical pecking order entirely. But if
Num is generic numerics then it could presumably be aliasable within
a lexical scope to any type that supports the pecking order. The
default would presumably be Flt.
Larry
the left, then
given @array {
when .match(42) {...}
}
will already reverse the test to mean 42 ~~ @array. As I say, we need to
figure out what to do with "foo".match(/bar/) though.
Larry
like
acc/rej
pix/nix
ok/bogus
Of course, all of the .rejects() variants could simply be spelled
.accepts().not, but that seem unnecessarily cruel.
Larry
Lots of interesting ideas. But I don't think the reverse-test
situation will arise all that frequently. How 'bout we let the user
just say:
my macro statement_control: { "when .accepts: " }
or some such...
Larry
a Match object, which as
a form of Capture would then try to compare itself back to $pattern,
which is not what you want. So you'd have to force it:
given $pattern {
when true $a ~~ $_ { ... }
when true $b ~~ $_ { ... }
when true $c ~~ $_ { ... }
}
Larry
;.
: >+Matching against a C does not actually bind any variables,
: >+but only tests to see if the signature I bind. To really bind
: >+to a signature, use the C<*> pattern to delegate binding to the C
: >+statement's block instead. Matching against C<*> is special in that
: >+it takes its truth from whether the subsequent block is bound against
: >+the topic, so you can do ordered signature matching:
: >+
: >+given $capture {
: >+when * -> Int $a, Str $b { ... }
: >+when * -> Str $a, Int $b { ... }
: >+when * -> $a, $b { ... }
: >+when * { ... }
: >+}
:
: Ooh ooh! Yay!
Figured you'd like that one...specially since it degenerates to what
we had before.
Anyway, thanks for reminding about the things that were bothering me
already, or that should have and didn't yet. :)
Larry
On Mon, Jan 08, 2007 at 06:05:10PM +0100, TSa wrote:
: HaloO,
:
: Larry Wall wrote:
: >On Sun, Jan 07, 2007 at 11:42:05AM +, Luke Palmer wrote:
: >: >+Hash Set hash keys same set $_.keys === $x
: >:
: >: You can either think of a hash as a set of pairs,
s and .exists need to be unified,
though the fact that I can't think of the other direction just
points out the fact that .exists has a poor valence linguistically
for expression subsetness. Maybe we should change .exists to .contains.
Hmm...
Larry
ation. It will enable us to write parsers
more consistently, and it also opens up normal regexes to better
optimization via tries and such. You can now use || for the old |
semantics, which is majorly consistent with how | and || work outside
of regexen.
Larry
On Tue, Jan 16, 2007 at 02:05:44PM -0600, Patrick R. Michaud wrote:
: On Tue, Jan 16, 2007 at 10:41:03AM -0800, Larry Wall wrote:
: > Note, in case you don't read synopsis checkins: the previous checkin
: > majorly changes the semantics of | within regex to support required
: >
at is, it would allow role A to define a method
: for role B.
I've decided "is commutative" must die of ill-definedness. See instead
the recent S13 change to support multiple signatures on a single body.
This approach seems to be both more general and better defined.
I like that, up to a point...
Larry
ber line
happen to be the same number most of the time. And Perl is not about
forcing a type-theoretical viewpoint on the user...
Larry
On Mon, Jan 22, 2007 at 08:47:22PM -0800, Darren Duncan wrote:
: At 5:56 PM -0800 1/22/07, Larry Wall wrote:
: >Whether a Num that happens to be an integer prints out with .0 is a
: >separate issue. My bias is that a Num pretend to be an integer when
: >it can. I think most folks (
type cast:
@@(zip(1,2;3,4))
But then people will try to write @@zip and wonder why it doesn't work...
The possibilities are endless, and I don't doubt that you can think of
a few more...
Larry
On Tue, Jan 23, 2007 at 07:23:31PM -0800, Darren Duncan wrote:
: At 6:22 PM -0800 1/23/07, Larry Wall wrote:
: >Recently I started redefining C to return multislices such that
: >
: >map { $_, $_ * 10 }, 1..3
: >
: >seems to return 1,10,2,20,3,30 by default, but in a m
Note: it would be good to break multiple questions into separate threads
with different subjects for those of us who use threaded mail readers,
so I will answer each of these with a different subject.
Larry
he sign before the subscript can
see it.
But it probably doesn't matter. If one really wants "infinite" modular
arrays, then you probably just say @array[$x % @array] or some such,
which gives you the floor semantics.
Larry
ld read through the iterator. That doesn't quite work unless we also
make it that $($*IN) returns the head of the iterator. So maybe that's
just a bogus idea.
Larry
codepoint offsets, but the
user should not rely on it.
Larry
nless you've
explicitly declared a multi to handle the situation.
Larry
nal
Whatever (**) will work to mean the same thing in "whatever" dimensions
there are:
@array[**-1]
No clue if that every would be useful to anyone...
Larry
27;s not clear how the eventual victim would know how to
distinguish *+42 from *-42 if it's only getting some kind of closure
to call. So I think we still have to dispatch to Whatever and let
the Whatever code extract any relevant relative information knowing
that a "dwim" was explicitly called for by use of *.
Larry
Um, negative indices on shaped arrays were outlawed several hours ago...
Larry
e. Maybe gmail thinks they're spam
because of too much self-similarity?]
Larry
On Tue, Jan 30, 2007 at 03:47:34PM -0800, Larry Wall wrote:
: This mornings up date proposed
Now the da rn spam fi1ters are chang.ng my spelling to look like sp*m.
Yeah, that's the 4icket... :)
Larry
.ASK
.QUERY
.STATUS
.PAIR
.ADV
I think I like STATUS the best at the moment. But I can just imagine
some coding standard mandating that it must be written:
if not STATUS "/tmp/foo": :r { die; }
Larry
:
: %hash.does('exists');
Why would you expect colon to do that? I don't see the prior art...
Larry
On Mon, Feb 05, 2007 at 02:41:06PM -0800, [EMAIL PROTECTED] wrote:
: typo from albery_b++
Figured I'd start in on all the possible misspellings now... O_o
Larry
you want to work on some part of the grammar, that's fine, but
either update frequently with svn or let me know which parts I should
leave alone while you work on them.
Larry
I should also point out that I'm excruciatingly grateful for all the
prior art in the various Perl 6 parsers that various random geniuses
have been working on. In particular:
pmichaud++
fglock++
putter++
audreyt++
Their parsers actually work, unlike mine. :)
Larry
27;Hello', 'World')?
The latter, just like shell quoting. Also just like shell quoting, you can
say my @bar = «"$foo" bar» to prevent the splitting of that interpolation.
Hmm, we very nearly have:
run «find "$dir" @options» ==> run «xargs rm -f»
Larry
interesting read on
combining traditional threading and event models in the same process,
see http://www.seas.upenn.edu/~lipeng/homepage/unify.html.)
Larry
me lexically. So maybe we can make the loop work as
long as we guarantee the rebinding of the pointy end always happens
after the forking and binding of the blunt end. Basically the blunt
end gives away the old variable to the subthread that is going to
filter it into the the list of values, and the sharp end rebinds the
name to a new container.
That's the only way I see it working right now.
Larry
No, that evaluates getValue() at compile time. He really just wants
the already specced form:
my $temperature is readonly = getValue();
Or maybe what he really wants is a pragma:
no mutators;
Larry
On Fri, Feb 16, 2007 at 12:07:43PM -0800, Steve Lukas wrote:
: Larry, Smylers, now I've read your answers.
: Larry, thanks for telling me that it is already specced.
: I have overlooked it, sorry.
: Hello Smylers, thanks for your answer, too. I'm not stucked on
: the form C<$-name
ist infix promotes to a meta operator,
the base operator goes in the middle. And if there's a stringwise or
scalar form, it's the single letter.
'Course, if someone goes ahead and adds the Y combinator, one must
naturally begin to wonder what the YY combinator would be... :-)
Larry
On Wed, Feb 21, 2007 at 12:49:20AM +0100, Thomas Wittek wrote:
: Larry Wall schrieb:
: > I think the ¥ and Y operators are going to have to change to something else.
:
: Very probably I missed something as I'm only a distant observer of the
: Perl6 development: Why not just call
On Tue, Feb 20, 2007 at 08:50:07PM -0500, Joe Gottman wrote:
: Larry Wall wrote:
: >Hmm, but then what corresponds to XX? I'd be more inclined to go
: >the other way and say that you can transform any list infix form to
: >the corresponding function form:
: >
: >@a ZZ @b Z
dwim. That'd have to turn into something like:
@array[ 0; @@( @array.shape[*[1]..*[-2]] ); 42 ]
Also +** might return a shape vector, or maybe +«**.
Larry
tence, usefulness and stability?
As long as Joshua and Caleb see the promised land for what it really is,
I don't worry too much about what other ten spies think. The right people
will decide to work on Perl 6 at the right time if the vision is right.
Larry
for those who think the above code is too easy -- and I can see at
: least 1, 2, 5, and 6 as defensible answers -- try 2.8 instead of 2.4.
I think either 5 or 6 is correct. See the recent S09 update.
Larry
compact struct, is the choice the same when byte-stringifying an
: array of same? In other words, are you guaranteed that the
: byte-stringify of an array of compact structs is merely the
: concatenation of the byte-stringification of each struct?
Yes.
Larry
u can always define
more specific multis or functions or macros, or whack the compiler
upside the head with a pragma.
Larry
ote that in either case we're using smartmatch,
so you're not going to make the =/== mistake.
Perhaps there should be something like the "first gather" that does
the gather assuming only one thing will be gathered. Unfortunately
"item gather" will still gather everything and make it [list].
Larry
#x27;s dependent on .process not returning a false on the final iteration.
Er, these days 'for' is more like 'map', and hence returns a list.
So it's dependent on at least one iteration returning a non-() value.
In fact, if the final iteration returned False, the list would be
considered true.
Larry
On Mon, Mar 05, 2007 at 03:56:16PM +1030, Tom Lanyon wrote:
: Larry Wall wrote:
: >On Sun, Mar 04, 2007 at 06:37:34PM -0800, Jonathan Lang wrote:
: >: Rick Delaney wrote:
: >: >Smylers wrote:
: >: >> for @invoice
: >: >> {
: >: >> .process;
: &g
ally: when used as a statement modifier, is "given" considered to
: be conditional or looping? (Gut instinct: conditional.)
Why does it have to be one or the other? It's just a topicalizer.
Larry
o allow you to derive from this
grammar and override the rules as you see fit. Macros and user-defined
are just convenient ways to define bits of grammar without actually
adding or modifying any rules, at least not overtly.
Larry
On Sun, Mar 04, 2007 at 09:38:05PM -0800, Larry Wall wrote:
: grammar and override the rules as you see fit. Macros and user-defined
s/user-defined/user-defined operators/
Larry
On Sun, Mar 04, 2007 at 09:44:59PM -0800, Jonathan Lang wrote:
: Larry Wall wrote:
: >: Finally: when used as a statement modifier, is "given" considered to
: >: be conditional or looping? (Gut instinct: conditional.)
: >
: >Why does it have to be one or the other? I
all assuming you don't like my original
for @invoice || fail 'No invoices to process'
{
.process
}
Larry
ler is what generally
resumes otherwise uncaught resumables. If you catch a warning,
it defaults to resuming when handled unless you rethrow it as fatal.
Larry
: testcase (if someone with commit bits can add it):
I'm sending you a commit bit so you can add tests. It's traditional
to add yourself to AUTHORS as the first checkin to make sure things work.
Larry
I like it. I'm a bit strapped for time at the moment, but if you send
me a patch for S09 I can probably dig up a program to apply it with. :)
Larry
ithout
automatically leaping to the next bleadtrack, using 6.2.* notation.
How do you do that in Perl 5?
Larry
On Thu, Mar 08, 2007 at 12:57:00PM -0700, David Green wrote:
: On 3/8/07, Larry Wall wrote:
: >Perl 6 is specced to keep all the old versions of modules around in
: >the library (unless the new version claims to emulate the old version).
:
: Oh, good! So how does a module say that it em
ist knows how to slurp. I think the <> is special
to just the prefix:<=> operator.
: - Can for <>.slurp.split {...} be trusted to not use a huge amount of
: memory for large inputs?
No, any .slurp is pretty much guaranteed to use memory. Also, split no
longer has a default. You probably want
for $*ARGS.comb {...}
Larry
ple sources to the next sink, double the angle:
: > +
: > +0..* ==> *;
: > +'a'..* ==>> *;
: > +pidigits() ==>> *;
:
: Can you append to something that isn't there? Would it matter if the
: first feed also had a double pointy bracket on it?
Doesn't matter, just thought it was a clearer example this way.
Larry
der the current definition of laziness (unless we allow
arbitrary pushback onto filehandles). But these days we're in the
mode where specs are being driven primarily by the implementors,
and nobody's working much on the IO layers/roles at the moment.
Feel free to whack on 'em if you like.
Larry
thinking that "emulates" encompasses that notion, but maybe we
haven't got the name quite right. And maybe we need an API naming
convention.
Larry
ys of arrays. The mapper just shoves any
early dimensions into the shape (if any), and the rest dangles off
each element as AoA (assuming the element type isn't forced to be a
simple type like Num there). Offhand I don't see much problem with
this, but maybe it's just a big blind spot.
Larry
; works currently.
Larry
just be a .terse or .key method of some sort feeding
to a normal %s.
Larry
ves the language
implementor whiplash. However, I rather suspect the interpersonal
metaphorical meaning was lost on the physicist/comic who decided that
the 3rd derivative of position should be called "jerk". :)
Larry
cals are not going to be terribly useful
in reduce. So I'm not inclined to change anything currently.
Larry
processing:
io('http://www.wall.org/~larry') ==> my @homepage;
Though we have a bit of a semantic problem insofar as
@source ==> io('file:foo')
is going to want to supply more arguments to io() rather than send
the feed to some method of the IO object, unless
'll have to say:
if my $a = testa(){ say "$a is true"}
elsif my $b = testb() { say "$a is false and $b is true"}
else { say "Neither $a nor $b is true"}
and live with the fact that $a and $b are also visible after the construct.
Larry
;ve probably
got the scope of the storage location wrong. And even if not, there
are several other ways to write it, at least one of which will be
generally more readable to other people.
I freely admit that it's less orthogonal and that I'm being high-handed. :)
Larry
s a match quickly while another processor starts
: earlier but needs to take a lot longer to find its first match,
: the lazy processing can start working on the first match found
: at the earliest possible time.
No, I'm not sure, which is why I put in the conjectures. :-)
Larry
s it get cast to an Int,
: >thereby discarding information?
:
: As I understand it, yes; a Float would be cast into an Int in this
: case. Though my understanding is that this says more about Ints and
: Nums than it does about objects in general.
Hmm, well, "returns Int" is explicitly asking for a coercion of the
return value, so it's at least as general as the coercion semantics
of the type system. (Which doesn't contradict what you just said,
of course.) However, that particular syntax doesn't advertise the
Int type as return value to the outside world, which means it could
not be used to trim a candidate list even if the provided sig filter
specified a return type. Need to use an --> (an "of" type) for that...
Larry
on attacks.
Larry
tins/io/say_and_print.t, oddly), so I've just
added it to pugs/docs/Spec/IO.pod, the proto-synopsis on IO.
Anyway, you should (eventually) just be able to say
{
temp $*DEFOUT := $MYFH;
foo();
}
to redirect the default output of foo() and then restore at the end of the
dynamic scope. That's an improvement over dancing the select twostep.
Larry
means
it can't really serve as the filename at the same time. So assuming
that any filehandle knows the name of its file (if available), it'd
probably be available via a method like $ARGS.name or some such.
Larry
On Tue, May 01, 2007 at 01:41:45PM -0400, Mark J. Reed wrote:
: On 5/1/07, Larry Wall <[EMAIL PROTECTED]> wrote:
: >The plan introduced in A06 was to leave $*('IN'|'OUT'|'ERR') bound
: >to stdin, stdout, and stderr (which can still be dickered with on
:
of the program, assuming
we go ahead with a unified events/threads model as suggested by
http://www.seas.upenn.edu/~lipeng/homepage/unify.html.
Larry
th $! and
$!foo currently. But there are very, very few punctuational variables
in Perl 6 compared to Perl 5. Most of 'em are just gone.
Larry
. Greek wouldn't be
Greek if you couldn't decline your nouns. (In my estimation, it's
the conjugated verbs that make Greek so difficult to learn, really.
On the other hand, once you learn them they're very expressive in
tense and aspect. It's all tradeoffs.)
Larry
ained but my google-fu was not good
: enough to find an answer.
Honest questions deserve honest answers, even if they aren't simple answers.
Larry
Language design is hard. Let's go shopping! :-)
Larry
: then again many languages don't follow that convention (Japanese,
: Korean, etc etc for instance).
Oddly, the statement modifier is borrowed directly from English.
: The same opinion goes for all loops, except the
:
: do { statement } ( { while, until } );
:
: variety.
That particular construct comprises several additional cans of worms. :)
Larry
ld seem to duplicate the existing construct:
$_ = $foo;
:-)
Of course, now someone will argue that unary:<=> should assign to $_ by
default, in which case we'd have to find a new interation operator...
Larry
he role. Or does this make it too easy to create new
: sigils?
Well, it's already too easy, but the problem I have with it is not
that. My problem is that sigil:<@> is the name of a very specific
syntactic notion, while Positional is the name of a very generic
semantic notion. I don't think those levels should be confused.
Larry
g that C<$x> may be bound to any object that does the C
: role?
Yes, provided we consider Junction and Any to both be subtypes of Object.
Larry
the candidate list than the normal count of type "Int".
So you could give it different semantics if you like.
Arguably, in Perl 6 people might instead write
say $foo.fmt("%20s"), $bar
but just because people can write it that way doesn't mean they will.
(Plus that approach doesn't work if you want to count tabs.)
And generally, I think
@list xx -1
is less readable than
@list.reverse
so I don't feel inclined to include it as another Way To Do It.
Larry
ut anything it knows
must fail at runtime, and since scalars default to eager, this will
certainly run out of memory at runtime.
Larry
infix:<-> interprets a * on the left to mean the end
of the current subscript range. And the range operator interprets *
to mean either negative or positive infinity depending on whether
it's on the left or the right. We don't require (or even allow)
people to say -*..* as it currently stands.
Larry
: do), does this match up with your expectations for the replication
: operators?
That's how x would work. See S03 for a description of how xx works.
Larry
want
to declare Any parameters more often than you want to talk about any
possible kind of Object, I suspect.
Hmm, maybe we should just rename Object to something more generic.
There are plenty of candidates:
Top
Idea
Noun
Item
Proto
Thing
Notion
Concept
Subject
Reality
Invocant
Universal
EveryThing
Abstraction
TheCosmicAll
Life::Universe::Everything
Larry
for *not* using Universal is also
political, insofar as Perl 5's UNIVERSAL has been sorely abused in
various ways, and I don't want people to have that mental association.
(Kinda like the fact that Captures resemble anonymous typeglobs but
we're *not* going to call them that...)
Larry
On Fri, Jun 01, 2007 at 06:05:58PM +0200, Thomas Wittek wrote:
: Daniel Hulme:
: >> Larry Wall:
: >>> I name things in English. Hash is just something that is disordered
: >
: >> I'm not a native english speaker, but I've never heard or read the word
: >>
On Fri, Jun 01, 2007 at 06:52:37AM -0400, Mark J. Reed wrote:
: On 6/1/07, Larry Wall <[EMAIL PROTECTED]> wrote:
: >Nope. Hash is mostly about meaning, and very little about implementation.
: >Please don't assume that I name things according to Standard Names in
: >Compu
ith the lists in parallel rather
than serially. And the list() in list(zip()) would just listify the
*results* of zip, not the arguments to zip...
: Or does '(@a;@b)' default to slice context?
Parentheses don't supply context. They only group. (@a;@b) returns
a list of captures. It requires a binding (or other sigil) coercion
to supply context.
Larry
not a good place to play mind games for
either the programmer or the compiler. There are very few true primitives
in Perl 6, and this is right up there close to lambdas, I suspect.
Larry
n strings will have to suffice. Of course, if the
"method" is nonalphanumeric, we're even less likely to find the method.
And in the alphanumeric case, we can probably also alert on the fact
that writing ."bar" is in fact a useless use of quotes.
These are the everyday worries of a language designer. Well, me anyway...
Larry
On Thu, Jun 14, 2007 at 09:20:51AM -0600, Thom Boyer wrote:
: Compare that with the simplicity that $larry & $damian are promoting.
Yes, and the simplicity we're promoting here is mostly *syntactic*
simplicity. It's obvious that at a semantic level, there has to be a
certain am
: all the way through these examples, BTW).
Well, and the fact that it's \x[3D] these days, not \x{3D}.
Larry
;s not blow it now.
In short, trying to make Pod and Perl 6 view a document identically
in every case is not worth the cost, in my estimation.
Larry
1301 - 1400 of 3168 matches
Mail list logo