Juerd:
> Rob Kinyon:
>> What about @array.indices instead?
>
> Oops, I said "indexes" in a former message.
AFAIK they share most of their meanings nowadays.
(My old Chambers says that indexes are books.)
> Maybe a good candidate for an alias?
No doubt about it.
--
Affijn, Ruud
"Gewoon is ee
TSa:
> Perhaps we
> can live with the numerically lower end always beeing part
> of the range, the larger one never,
I don't think so.
>0 .. 5 == ( 0, 1, 2, 3, 4)
{ action } for 0 .. 5
is supposed to run for 0,1,2,3,4,5.
But '0 .. ^5' should not mean '( 0, 1, 2, 3, 4, 5)' just becaus
Roger Browne:
> Unfortunately I could only get to Ack(3, 6) before parrot aborted with
> "maximum recursion depth exceeded", at recursion depth 1000.
Alternative:
#!/usr/bin/perl
use strict;
use warnings;
use Memoize;
{ local ($,, $\) = ("\t", "\n");
sub ack {
return $_[1] +1 if 0 ==
Leopold Toetsch:
> Dr.Ruud:
>> Roger Browne:
>>> Unfortunately I could only get to Ack(3, 6) before parrot aborted
>>> with "maximum recursion depth exceeded", at recursion depth 1000.
>>
>> Alternative: use Memoize;
>
> Sure. And there is
Ruud H.G. van Tol schreef:
> [RD-interface]
See also these Haskell Hierarchical Libraries (base package)
http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Set.html
http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Map.html
--
Affijn, Ruud
"Gewoon is een tijger."
Larry Wall schreef:
> Ruud H.G. van Tol:
>> Uri Guttman:
>>> When cast into an array, you can access all the positional
>>> arguments; Into a hash, all named arguments; Into a scalar, the
>>> invocant; Into code, into slurpy nameless block.
>>
>> The last 'into' should be 'the'.
And it has becom
Uri Guttman schreef:
> you might as well attribute the s:g/Into/into/ to dr. ruud.
Right, s:g/I/i/ is all that remained. I really was amazed by your new
capitalization style.
:)
--
Affijn, Ruud
"Gewoon is een tijger."
(posted via news://nntp.perl.org again)
"Ruud H.G. van Tol" schreef:
> Juerd:
>> autrijus:
>>> -&foo.($arg1, $arg2);
>>> +&foo. ($arg1, $arg2);
>> [...]
>> Please reconsider.
>
> Yes, please come up with a different character to
> bridge/cross/hide/cloak/skip/zap the succeeding "not allowed"
> whitespace.
>
> Maybe the "\"
[EMAIL PROTECTED] schreef:
> +The unary prefix operator C<*> casts a value to an C
s/\ban\b/a
> @@ -1340,7 +1340,7 @@
> PairTuple of two elements that serves as an one-element
idem
> +my $ref = [EMAIL PROTECTED]; # $ref is an Capture object - see S02
idem
--
Affijn
[EMAIL PROTECTED] schreef:
> Author: autrijus
> Date: Sun Apr 16 18:24:04 2006
> New Revision: 8724
>
> Modified:
>doc/trunk/design/syn/S06.pod
>doc/trunk/design/syn/S09.pod
>
> Log:
> * more typo cleanups promted by Dr. Ruud.
I love tradition: s/mt/mpt
;)
> -The unary prefix operator C<
"Jonathan Lang" schreef:
> When is the last time that you saw an underscore-only method name?
sub _{print"$_\n"};
--
Affijn, Ruud
"Gewoon is een tijger."
Instead of /ee say:
s/pattern/{ eval doit() }/
s/eval/try/ ?
--
Affijn, Ruud
"Gewoon is een tijger."
S11, near the end:
s/beings/begins/
:)
--
Affijn, Ruud
"Gewoon is een tijger."
What would be the way to define-or-set that a specific hash has
non-case-sensitive keys?
Or broader: that the keys should be normalized (think NFKC()) before
usage?
Would it be easy to "delegate it to the hash"? (or use a hardly
noticeable wrapper)
--
Affijn, Ruud
"Gewoon is een tijger."
Larry Wall schreef:
> Dr.Ruud:
>> What would be the way to define-or-set that a specific hash has
>> non-case-sensitive keys?
>
> Use a shaped hash with a key type that defines infix:<===>
> appropriately, since object hashes are based on infix:<===> rather
>
"Chris Yocum" schreef:
> print @array[0] ~ "|" ~ @array[1] ~ "|" ~ @array[2] . "\n";
First the Perl6-equivalent of
$" = '|' ;
and then
say "@array" ;
--
Affijn, Ruud
"Gewoon is een tijger."
"Michael Mathews" schreef:
> [compile down to a *language independent* format]
> So does that mean I can write a module in Perl 6, deliver it to Mr.
> Customer as byte-code. Then Mr. Customer can "decompile"(?) it into
> Python (or JavaScript, or C, etc), edit it, and then compile it back
> into w
"Michael Mathews" schreef:
> [attribution repaired] Ruud:
>> [attribution repaired] Michael:
(Michael previously sent me an independent off-list reply; we're back on
the list now)
>>> As I gradually learn how Parrot works, I see that perhaps the idea
>>> of decompiling byte-code into language ___
"Gabor Szabo" schreef:
> {Cobol etc.]
> IMHO - and I really saw only a few such companies - these companies
> have 0 automatic tests so it would cost them a lot of time and money
> to test their application on the new and shiny Cobol compiler.
I once worked on tests for a national center of a ban
Allison Randal schreef:
> Chip Salzenberg:
>> The below patches are my guess as to how to fix PGE and TGE for the
>> recent change in .namespace. (That is, C<.namespace ['']> now means
>> what it says, and the HLL root is reachable by C<.namespace> w/o
>> parameters.)
>
> TGE and PGE both need a
Aaron Sherman schreef:
> given $_ {
>when $x {...}
> }
>
> or
>
> $_ ~~ $x
Can that be written as ".~~ $x"?
--
Affijn, Ruud
"Gewoon is een tijger."
"Mark A. Biggar" schreef:
> Darren Duncan:
>> Now, I didn't see them yet anywhere in Synopsis 3, but I strongly
>> recommend having negated versions of all these various types of
>> equality tests. Eg, !== for ===, nev for eqv, etc. They would be
>> used very frequently, I believe (and I have ev
Larry Wall schreef:
> Dr.Ruud:
>> Aaron Sherman:
>>> $_ ~~ $x
>>
>> Can that be written as ".~~ $x"?
>
> No, but you might just possibly get away with writing:
>
> .infix:<~~>($x)
>
> assuming that the $_.foo($x) SMD eventually
Darren Duncan schreef:
> Dr.Ruud:
>>>say "foo" if $x !== $y;
>>> into
>>>say "foo" unless $x === $y;
>>
>> And how about symmetry:
>>say "foo" unless $y === $x;
>
> Any equality or inequality ope
"Will Coleda via RT" schreef:
> Thanks, applied as r13316.
Twice?
3c3
< Xref: nntp.perl.org perl.perl6.internals:34222
---
> Xref: nntp.perl.org perl.perl6.internals:34223
7c7
< Received: (qmail 22397 invoked from network); 16 Jul 2006
15:09:07 -
---
> Received: (qmail 22778 invoked from net
As sometimes Perl6 to Perl5 is explained as C++ to C:
Newsgroups: rec.arts.humor
Subject: The truth about 'C++' revealed
Date: Tuesday, December 31, 2002 5:20 AM
On the 1st of January, 1998, Bjarne Stroustrup gave an interview to the
IEEE's 'Computer' magazine.
Naturally, the editors thought he
David Green schreef:
> ===
> ...is equality-of-contents, basically meaning that the things you're
> comparing contain the same [...] values.
How about strings; are normalized copies used with the === ?
http://www.unicode.org/faq/normalization.html
http://www.unicode.org/notes/tn5/
--
Affijn, R
"Markus Laire" schreef:
> my $x = 'Just Another';
> my $y := $x;
> $y = 'Perl Hacker';
>
> After this, both $x and $y contain the string "Perl Hacker", since
> they are really just two different names for the same variable.
>
So "$x === Sy" stil holds.
--
Affijn, Ruud
"Gewoon is e
"Markus Laire" schreef:
> Dr.Ruud:
>> Markus Laire:
>>> my $x = 'Just Another';
>>> my $y := $x;
>>> $y = 'Perl Hacker';
>>>
>>> After this, both $x and $y contain the string "Perl Hacker"
Larry Wall schreef:
> Dr.Ruud:
>> Comparing strings in Perl5, using NFKD:
>>
>> perl5 -MUnicode::Normalize -we '
>> ($\, $,) = ("\n", "\t") ;
>> $x = qq{Henry IV} ;
>> $y = qq{Henry \x{2163}} ;
>> print qq{<$
"Stuart Cook" schreef:
> Larry Wall:
>> if 0 {
>> ...
>> }
>
> The one disadvantage of that approach is that it will break if the
> "commented-out" code temporarily fails to compile.
How frequent does that happen?
And in that case s/if 0/\#/, as Luke mentioned.
And if the compile fai
"Carl Mäsak" schreef:
> Ruud:
>> Carl:
>>> But maybe a variable that implicitly carries along the loop index
>>> would be even snazzier?
>>>
>>> for @array -> $val {
>>> say "$.\t$val";
>>> }
>>
>> Or give the block a name (label), and have an index (or several
>> indexes, like some that are res
Carl Mäsak schreef:
> I suppose doing a map or a grep over @array.kv is possible:
>
> pugs> my @array =
> ("london", "bridge", "is", "falling", "down")
>
> pugs> map { "Element $^a is called $^b" }: @array.kv;
> ("Element 0 is called london",
> "Element 1 is called bridge",
> "Element 2 is call
Damian Conway schreef:
> [attribution repaired] Carl:
>> But it can hardly be blamed for clarity.
>
> That's a little unfair.
"can hardly be blamed" -> "can easily be praised"
--
Affijn, Ruud
"Gewoon is een tijger."
"Damian Conway" schreef:
> Ruud:
>> Damian:
>>> Carl:
But it can hardly be blamed for clarity.
>>>
>>> That's a little unfair.
>>
>> "can hardly be blamed" -> "can easily be praised"
>
> Apologies to Carl if I misinterpreted. I read it as:
> "can hardly be blamed for (having) clarity"
>
Damian Conway schreef:
> [for @array -> $index, $value {...}]
>
> No. There's no such magic. I simply screwed up. I should have written:
> for @array.kv -> $index, $value {...}
> :-(
Ah, much clearer now.
--
Affijn, Ruud
"Gewoon is een tijger."
Paul Seamons schreef:
> The following is one more interesting case.
>
> say "Ok then" if $yes and $true unless $no or $false;
>
> Without nested modifiers you'd have either:
>
> say "Ok then" if $yes and $true and ! $no and ! $false;
>
> or
>
> say "OK then" unless ! $yes or ! $true or $no $or $fa
Paul Seamons schreef:
> In the samples you gave I had to read the entire line to see
> what the outcome of the code is.
I was not addressing reading skills, but just your "you'd either have
... or ...". One always needs to read the full line, but one doesn't
have to do that linearly or just from
larry schreef:
> +Likewise, from the fact that list context flattens inner arrays and
> +lists, it follows that a reduced assignment does no special syntactic
> +dwimmery, and hence only scalar assigments are supported. Therefore
> +
> +[=] $x, @y, $z, 0
> +[+=] $x, @y, $z, 1
> +
> +are e
Larry Wall schreef:
> Dr.Ruud:
>> larry:
>>> +Likewise, from the fact that list context flattens inner arrays and
>>> +lists, it follows that a reduced assignment does no special
>>> syntactic +dwimmery, and hence only scalar assigments are
>>> suppo
Mark J. Reed:
> Aaron Sherman:
>> Proposal: A sigil followed by [...] is always a composer for that
type.
>>
>> %[...] - Hash. Unicode: ?...?
>> @[...] - Array. Unicode: [...]
>> ? - Seq. Unicode: ?...?
>> &[...] - Code. Unicode: ?...?
>> |[...] -
Smylers schreef:
> in
> this particular case the particular behaviour involves _executing as
> Perl code something which the programmer never intended to be code in
> the first place_. That's crazily dangerous.
I wouldn't mind eval() to be off by default, so to have to put a "use
eval" in every
"Jonathan Lang" schreef:
> role R does A does B does C { ... } # unordered composition
> $x does A does B does C; # ordered composition
> $y does A | B | C; # unordered composition
>
> I'd like to see it done something like:
>
> role R does A does B does C { ... } # unordered com
Smylers schreef:
> my $whatever
> = do { my $baz = $bar * 17; my $quux = $baz - 3; $baz / $quux };
($bar better not be 3/17)
Just a rewrite:
my $whatever
= do { my $quux = (my $baz = $bar * 17) - 3; $baz / $quux };
And maybe even something like:
my $whatever
= do
Smylers schreef:
> Ruud H.G. van Tol:
>> Darren Duncan:
>>> TSa:
set operations ... make them Bag operations to start with.
>>>
>>> I agree with ... making Set the main type and making Bag an
>>> extension built upon that, as complex is built upon num, etc.
>>
>> I don't think that will work
"Luke Palmer" schreef:
> When do we do integer/rational math and when do we do floating point
> math?
>
> That is, is 1 different from 1.0? Should 10**500 be infinity or a 1
> with 500 zeroes after it? Should 10**10**6 run out of memory? Should
> "say (1/3)**500" print a bunch of digits to the
Joe Gottman schreef:
> When you call map on a multislice, does it do deep or shallow
> iteration?
And with deep, there is the choice: depth first or not.
--
Affijn, Ruud
"Gewoon is een tijger."
[EMAIL PROTECTED] schreef:
> Just glad someone's reading these things...
Of course we are. But it is hard to react when the syntax isn't in your
muscle memory yet.
>From r13565:
> +%hash.:exists{$key}
I would expect
%hash.exists{$key}
with the shortcut
%hash.:{$key}
to test (at ru
Larry Wall schreef:
> Dr.Ruud wrote:
>> I would expect
>>
>> %hash.exists{$key}
>
> Except $foo.bar{$key} is interpreted as $foo.bar().{$key}. Things
> like "exists" and "delete" need to evaluate the key before calling
> the meth
Steve Lukas schreef:
> In between, I think 'variable' is too long, so:
> $code =~ s/variable/vari/g;
I don't think it is too long, since most of the times you don't need to
mention it. Could 'rw' be an alias?
my rw @heredoc_stubs is context = ();
my @heredoc_stubs is rw context = ();
my
David Green schreef:
> Jonathan Lang:
>> (In fact, the semantics for "@x[*+n]" follows directly from the fact
>> that an array returns the count of its elements in scalar context.)
>> And "@x[*]" would be the same as "@x[0..^*]" or "@x[0..(*-1)]".
>
> That's an elegance in its favour.
In Perl5 a
[EMAIL PROTECTED] schreef:
> -Attempting to access an index outside a array's defined range will
> fail:
> +Attempting to access an index outside an array's defined range
> will fail:
Idea for Perl6 test code: detecting (simple) typos in documentation.
--
Affijn, Ruud
"Gewoon is een tijger."
Markus Laker schreef:
> If I've got this right:
>
> mangle $foo :a;# mangle($foo, a => 1);
> mangle $foo: a;# $foo.mangle(a());
>
> So these --
>
> mangle $foo:a;
> mangle $foo : a;
>
> are ambiguous and, as far as I can tell from the synopses, undefined.
> So what's the rule: that ind
"TSa (Thomas Sandlaß)" schreef:
> Larry Wall:
>> Another potential issue is that CATCH doesn't distinguish exceptions
>> coming from the current block from those coming from the subcall to
>> a(). So it could end up returning Failure from the current block when
>> you intended to force return of F
"Jonathan Lang" schreef:
> I'm not fond of the 'ox\soxen' idea; but I could get behind something
> like '\s' or 'ox\s'.
"$n ox\s< en>"
"$n\s cat\s< s > fight\s< s s>"
;)
--
Affijn, Ruud
"Gewoon is een tijger."
TSa schreef:
> Brandon S. Allbery:
>> It occurs to me that this shouldn't be new keywords, but adverbs,
>> i.e. ``is :strict Dog''.
>
> Great idea!
And it leaves room for ':stricter' and ':strictest'.
;)
--
Affijn, Ruud
"Gewoon is een tijger."
56 matches
Mail list logo