> > @fib[1, 5, 10..15, 20]
> (1 8 (89 144 233 377 610 987) 10946)
> ^
>
> Why???
As Joe noted in his last email:
> remember, back in perl-land the default behavior is to flatten,
> in raku ... by default [raku is] oriented toward building up
> complex structures like
I didn't understood
> my @fib = 1,1, * + * … *;
[...]
> @fib[1]
1
> @fib[5]
8
> @fib[1..5]
(1 2 3 5 8)
*> @fib[1, 5, 10..15, 20](1 8 (89 144 233 377 610 987) 10946)*
* ^*
Why???
On Mon, Dec 7, 2020 at 2:27 AM William Michels via perl6-users <
perl6-users@perl.org>
On Sun, Nov 29, 2020 at 6:38 PM Ralph Mellor
wrote:
> > Zen slicing as a possible way of 'de-containerizing' :
> > https://docs.raku.org/language/subscripts#index-entry-Zen_slices
>
> A zen-slice only affects the single reference it's applied to.
>
> And it is a no op when applied to anything oth
ToddAndMargo via perl6-users wrote:
> I am a little late to this conversation, but `,=`
> looks a lot like `push` to me.
Yes that was my first impression, if you read ahead a bit in the
discussion you'll see it explained.
In summary: the = shortcuts all work in a precisely parallel way, so
@r
Hi All,
I am a little late to this conversation, but `,=`
looks a lot like `push` to me. Am I missing
something?
-T
William Michels wrote:
> Joe, what would you expect the code below to produce?
> %h<> ,= c => 3;
> @a[] ,= 'd';
Well *I* expect it to error out, but that's my p5 brain talking.
The Raku approach is if you ask for nothing it gives you
everything, so an empty index like that essentially doesn'
> Ralph Mellor wrote:
> >> > @r = @r , 'd';
> >>
> >> There isn't anything very useful in this behavior though, is there?
>
> Just to be clear, I wasn't saying I didn't think circular references
> should be forbidden, I just spe
> Zen slicing as a possible way of 'de-containerizing' :
> https://docs.raku.org/language/subscripts#index-entry-Zen_slices
A zen-slice only affects the single reference it's applied to.
And it is a no op when applied to anything other than a `Scalar`.
So it'll have no effect when applied direct
On Sun, Nov 29, 2020 at 9:16 AM Joseph Brenner wrote:
>
> William Michels wrote:
> >> > "Perhaps more importantly, what improvement do you propose?"
> >
> > Apologies for top-posting, but what immediately comes to my mind upon
> > encountering the creation of a self-referential (circular/infinite
William Michels wrote:
>> > "Perhaps more importantly, what improvement do you propose?"
>
> Apologies for top-posting, but what immediately comes to my mind upon
> encountering the creation of a self-referential (circular/infinite)
> object is proverbially 'going-down-a-level' and trying again. S
Joseph Brenner wrote:
> Just to be clear, I wasn't saying I didn't think circular references
should be forbidden,
Sorry about the double-negative. It could use another "not" to triple it.
s there?
>
> Yes.
>
> Here are some relevant results from a search for "self referential" in
> the #perl6 and #raku logs.
Just to be clear, I wasn't saying I didn't think circular references
should be forbidden, I just specifically meant that you weren't likely
y very desirable. It's so
> much easier to teach and learn a rule like "op= has the same effect,
> whatever "op" is; it takes the variable on the LHS, applies the
> operator to its contents and the other value on the RHS, then puts the
> result back on the LHS side.
Having a consistent ("regular", in the linguistic sense), structure
for something like the op= form is obviously very desirable. It's so
much easier to teach and learn a rule like "op= has the same effect,
whatever "op" is; it takes the variable on the LHS, applies th
> > "Perhaps more importantly, what improvement do you propose?"
Apologies for top-posting, but what immediately comes to my mind upon
encountering the creation of a self-referential (circular/infinite)
object is proverbially 'going-down-a-level' and trying again. So I
tried 1. 'decontainerizing'
> > @r = @r , 'd';
>
> Okay, that makes sense. So the circular reference I thought I
> was seeing is really there, and it's working as designed.
>
> There isn't anything very useful in this behavior though, is there?
Yes.
Here are some relevant results from a search for "self referential" in
the
About the documentation in general...
> > that particular pair-input syntax is my least favorite.
> > Flipping around the order of key and value when the value is a numeric...?
> >
> > And it isn't needed to demo the operator, any pair input syntax works.
> >
First off, much thanks to Ralph Mellor for his detailed explanations.
Ralph Mellor wrote:
> @r ,= 'd';
>
> The above expands to:
>
> @r = @r , 'd';
Okay, that makes sense. So the circular reference I thought I
was seeing is really there, and it's working as designed.
There isn't anything very
I accidentally sent this privately.
-- Forwarded message -
From: Ralph Mellor
Date: Fri, Nov 27, 2020 at 6:06 PM
Subject: Re: The ,= operator
To: William Michels
> I can reproduce your results on Rakudo_2020.10, but I'm afraid I don't
> have much more
that
value "inside" the `Scalar` container. This is what it means to "assign to"
a `Scalar`.
In all other cases the compiler passes *a list of values* at runtime to the
receiver.
What that receiver does with the list depends on the receiver's class.
> th
Hi Joe,
I can reproduce your results on Rakudo_2020.10, but I'm afraid I don't
have much more to say about the ",=" operator since I'm unfamiliar
with it.
Do the "docs" page(s) make more sense changing the phrase
"class-dependent" behavior to "ha
I was going through the operator list in the documentation the
other day, and I noticed this one:
postfix ,=
Creates an object that concatenates, in a class-dependent way,
the contents of the variable on the left hand side and the
expression on the right hand side:
my %a = :11a
22 matches
Mail list logo