> On 30/06/2023 06:06, ToddAndMargo via perl6-users wrote:
>> if @*ARGS.elems > 0 && "@*ARGS[0]".lc eq "debug" {...}
On 6/30/23 02:40, Richard Hainsworth wrote:
I tried this and it worked without any problem.
And today is is working for me as well without
a problem. I must have had somethin
;> that you can safely use them after a list operator without the need
>> for
>> parentheses:
>>
>> unlink "alpha", "beta", "gamma"
>> or gripe(), next LINE;
>>
>> With the C-style
out the need for
> parentheses:
>
> unlink "alpha", "beta", "gamma"
> or gripe(), next LINE;
>
> With the C-style operators that would have been written like this:
>
> unlink("alpha", "beta", "ga
or gripe(), next LINE;
With the C-style operators that would have been written like this:
unlink("alpha", "beta", "gamma")
|| (gripe(), next LINE);
It would be even more readable to write that this way:
unles
And then nobody mentions that `and` has low priority. Try `say 42 & 13` and
`say 42 and 13`.
Best regards,
Vadim Belman
> On Jun 30, 2023, at 9:45 AM, yary wrote:
>
> Most of Richard's parting suggestions I understand & agree with, but not
> this: " why are you using '&&' and not 'and' "
>
Most of Richard's parting suggestions I understand & agree with, but not
this: " why are you using '&&' and not 'and' "
My habit (from Perl 5 days) is to use && || for expressions, and reserve
"and" "or" for "do this if assignment/function call without parens
succeeds/fails" – is there a refinemen
I tried this and it worked without any problem.
Here's the whole program:
use v6.d;
say @*ARGS.raku;
if @*ARGS.elems > 0 && "@*ARGS[0]".lc eq "debug" {
say 'got' }
and at the terminal:
$ raku todd-test.raku debug --debug=50
["debug", "--debug=50"]
got
FWIW
why are you quoting ARGS? The .l
Hi All,
This gets the finger wagged at me for a "Nil"
when @*ARGS.elems equals zero:
if @*ARGS.elems > 0 && "@*ARGS[0]".lc eq "debug" {...}
I have to do this instead:
if @*ARGS.elems > 0 {
if "@*ARGS[0]".lc eq "debug" {...}
}
Do I misunderstand something? In an AND, is
not the test
On 12/30/20 5:41 PM, ToddAndMargo via perl6-users wrote:
A question on the "use" in a class declaration.
In "use $.x". does the dot have a special meaning
or is it just to make the value ($.x) easier to
access ($objectname.x)?
Many thanks,
-T
From my in p
A question on the "use" in a class declaration.
In "use $.x". does the dot have a special meaning
or is it just to make the value ($.x) easier to
access ($objectname.x)?
Many thanks,
-T
# New Ticket Created by "Carl Mäsak"
# Please include the string: [perl #108866]
# in the subject line of all future correspondence about this issue.
# https://rt.perl.org:443/rt3/Ticket/Display.html?id=108866 >
nom: class A { method x() { }; method x() { } }
nom d83a1c: OUTPUT«===SORRY!===
[EMAIL PROTECTED] wrote:
I am trying to understand the following small portion from S12, and it
seems slightly ambiguous to me:
=== from S12:
You may wish to declare an attribute that is hidden even from the
class; a completely private role attribute may be declared like this:
C
The na
I am trying to understand the following small portion from S12, and it
seems slightly ambiguous to me:
=== from S12:
You may wish to declare an attribute that is hidden even from the
class; a completely private role attribute may be declared like this:
C
The name of such a private attrib
On Thu, Oct 16, 2008 at 02:56:28PM +1100, Timothy S. Nelson wrote:
> Hi all. I'm working on the code for trees that I keep talking about,
> and I have code that somewhat resembles the following:
>
> role Tree::Node does Array {
> has Tree::Node @!children handles ;
> }
>
> The
Hi all. I'm working on the code for trees that I keep talking about,
and I have code that somewhat resembles the following:
roleTree::Node does Array {
has Tree::Node @!children handles ;
}
The intent of this code is that, if you treat the Tree::Node as an
array, you're operatin
gabriele renzi <[EMAIL PROTECTED]> writes:
> Steffen Schwigon ha scritto:
>> I looked at [1]. What's the purpose of "multi" in this case?
>> (Maybe you wanted to write it as more than one subs, did you?)
>
> look the comment:
>
> # Yet, it should be possible to define it even for commutative rings
Steffen Schwigon ha scritto:
Hi!
gabriele renzi <[EMAIL PROTECTED]> writes:
Hi everyone!
I solved the (easy) problem 32, implementing gcd($a,$b).
You can check the code in the repository or on the web[1]
I looked at [1]. What's the purpose of "multi" in this case?
(Maybe you wanted to write
Hi!
gabriele renzi <[EMAIL PROTECTED]> writes:
> Hi everyone!
>
> I solved the (easy) problem 32, implementing gcd($a,$b).
> You can check the code in the repository or on the web[1]
I looked at [1]. What's the purpose of "multi" in this case?
(Maybe you wanted to write it as more than one subs,
Hi everyone!
I solved the (easy) problem 32, implementing gcd($a,$b).
You can check the code in the repository or on the web[1]
But while writing this I noticed that a function written as
sub gcd(Int $a, Int $b)
still accepts float/rational values in input.
I think I read once that a variable
From: Chip Salzenberg <[EMAIL PROTECTED]>
Date: Wed, 14 Jun 2006 12:05:29 -0700
[ Note to p6c: This thread is about the proposed and only partially
specified ".begin_eh"/".end_eh" directives that would specify exception
handling as a static property of a range of opcodes in a su
[ Note to p6c: This thread is about the proposed and only partially
specified ".begin_eh"/".end_eh" directives that would specify exception
handling as a static property of a range of opcodes in a subroutine,
rather than the current dynamic approach of C etc. I'm
including p6c in case Lisp
From: Chip Salzenberg <[EMAIL PROTECTED]>
Date: Mon, 12 Jun 2006 06:54:24 -0700
On Sun, Jun 11, 2006 at 11:52:14AM -0400, Bob Rogers wrote:
>I notice the following paragraph, vintage late May, in
> pdd23_exceptions.pod:
>
>A C<.begin_eh> directive marks the beginning
On Sun, Jun 11, 2006 at 11:52:14AM -0400, Bob Rogers wrote:
>I notice the following paragraph, vintage late May, in
> pdd23_exceptions.pod:
>
> A C<.begin_eh> directive marks the beginning of a span of
> opcodes which the programmer expects to throw an exception. If
> an exc
I notice the following paragraph, vintage late May, in
pdd23_exceptions.pod:
A C<.begin_eh> directive marks the beginning of a span of
opcodes which the programmer expects to throw an exception. If
an exception occurs in the execution of the given opcode span,
P
On Sun, Mar 06, 2005 at 12:30:43PM -0500, Garrett Rooney wrote:
: Autrijus Tang wrote:
: >On Sat, Mar 05, 2005 at 02:39:06PM -0700, Luke Palmer wrote:
: >
: >>Garrett Rooney writes:
: >>
: >>>Garrett Rooney wrote:
: >>>
: >>>
: Assuming the spec is correct, here's a patch to add some more tests
Autrijus Tang wrote:
On Sat, Mar 05, 2005 at 02:39:06PM -0700, Luke Palmer wrote:
Garrett Rooney writes:
Garrett Rooney wrote:
Assuming the spec is correct, here's a patch to add some more tests to
t/op/string_interpolation.t.
Of course, those should have been todo_is tests... Here's the right p
On Sat, Mar 05, 2005 at 02:39:06PM -0700, Luke Palmer wrote:
> Garrett Rooney writes:
> > Garrett Rooney wrote:
> >
> > >Assuming the spec is correct, here's a patch to add some more tests to
> > >t/op/string_interpolation.t.
> >
> > Of course, those should have been todo_is tests... Here's the
On Wed, Sep 01, 2004 at 07:08:57PM +0200, Juerd wrote:
: Larry Wall skribis 2004-09-01 8:02 (-0700):
: > : $x.transform.();
: > That might not work either. This will, though:
: > ($x.transform)();
:
: This is surprising. Can you please explain why .() won't work? I have
: methods return su
Larry Wall skribis 2004-09-01 8:02 (-0700):
> : $x.transform.();
> That might not work either. This will, though:
> ($x.transform)();
This is surprising. Can you please explain why .() won't work? I have
methods return subs quite often, and like that I can just attach ->() to
it to make
On Wed, Sep 01, 2004 at 08:02:33AM -0700, Larry Wall wrote:
: That might not work either. This will, though:
:
: ($x.transform)();
So will
$x.transform()();
for that matter...
Larry
On Wed, Sep 01, 2004 at 10:41:37AM -0400, Aaron Sherman wrote:
: How do you declare attribute functions? Specifically, I was thinking
: about map and what kind of object it would return, and I stumbled on a
: confusing point:
:
: class mapper does iterator {
: has &.transform;
How do you declare attribute functions? Specifically, I was thinking
about map and what kind of object it would return, and I stumbled on a
confusing point:
class mapper does iterator {
has &.transform;
...
}
Ok, that's fine, but what kind of access
At 2:21 PM -0500 4/22/04, Abhijit A. Mahabal wrote:
This is actually a couple of questions:
1: can you extend roles by saying: role Set is extended {}
Parrot will allow this, so if Larry says OK you're fine. It may be
rather significantly expensive, however. (Not nearly as bad as, say,
adding an
On Fri, Apr 23, 2004 at 09:42:51AM -0700, Larry Wall wrote:
: : return $self.keys.grep { exists $other{$^a} }
:
: grepping a hash?
Sorry--looked at that cross-eyed. Of course you can grep the keys...
Larry
On Thu, Apr 22, 2004 at 02:21:17PM -0500, Abhijit A. Mahabal wrote:
: This is actually a couple of questions:
: 1: can you extend roles by saying: role Set is extended {}
Perhaps. Classes and objects that have already composed the role
would have to be notified that they need to recalculate colli
This is actually a couple of questions:
1: can you extend roles by saying: role Set is extended {}
2: if yes, does this change variables for which you said $var does Set?
In other words, is the singleton class like a closure or a first-class
class?
What follows is just some example code in case
Piers Cawley <[EMAIL PROTECTED]> writes:
> Larry Wall <[EMAIL PROTECTED]> writes:
>
>> Piers Cawley writes:
>> : Yeah, that's sort of where I got to as well. But I just wanted to make
>> : sure. I confess I'm somewhat wary of the ';' operator, especially
>> : where it's 'unguarded' by brackets, a
Larry Wall <[EMAIL PROTECTED]> writes:
> Piers Cawley writes:
> : Yeah, that's sort of where I got to as well. But I just wanted to make
> : sure. I confess I'm somewhat wary of the ';' operator, especially
> : where it's 'unguarded' by brackets, and once I start programming in
> : Perl 6 then
>
Piers Cawley writes:
: Yeah, that's sort of where I got to as well. But I just wanted to make
: sure. I confess I'm somewhat wary of the ';' operator, especially
: where it's 'unguarded' by brackets, and once I start programming in
: Perl 6 then
:
: for (@aaa ; @bbb -> $a; $b) { ... }
:
: w
[reformatting response for readability and giving Glenn a stiff talking
to]
Glenn Linderman <[EMAIL PROTECTED]> writes:
> Piers Cawley wrote:
>
>> Okay boys and girls, what does this print:
>>
>> my @aaa = qw/1 2 3/;
>> my @bbb = @aaa;
>>
>> try {
>> print "$_\n";
>> }
>>
>> for @aaa; @bbb ->
That particular example is flawed, because the try expression is turned
into a try statement because the } stands alone on its line.
But if you eliminate a couple newlines between } and for, then your
question makes sense (but the code is not well structured, but hey, maybe
you take out all the n
Okay boys and girls, what does this print:
my @aaa = qw/1 2 3/;
my @bbb = @aaa;
try {
print "$_\n";
}
for @aaa; @bbb -> my $a; my $b {
print "$a:$b";
}
I'm guessing one of:
1:1
2:2
3:3
or a syntax error, complaining about something near
C<@bbb -> my $a ; my $b {>
In other words, how
42 matches
Mail list logo