> > @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-us...@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
On 3 April 2012 20:38, Moritz Lenz wrote:
> which version of Rakudo are you using? (I've tried on the last
> development version from git)
Rakudo Star 2012.02
% perl6 --version
This is perl6 version 2012.02 built on parrot 4.1.0 revision 0
>> Hmm... So you'd have to mess with the STORE method
On 04/03/2012 08:24 PM, Daniel Carrera wrote:
> On 3 April 2012 17:24, Moritz Lenz wrote:
>> You can, very nearly. You just need to write
>>
>> my @vec is Vector;
>>
>> because you really want to change the type of the container, not just of the
>> contents (my Vector @vec would be an array contai
On 3 April 2012 17:24, Moritz Lenz wrote:
> You can, very nearly. You just need to write
>
> my @vec is Vector;
>
> because you really want to change the type of the container, not just of the
> contents (my Vector @vec would be an array containing Vector objects).
Another option might be to jus
ntactic. In the case of list assignment,
@foo.STORE(1..10) is called under the hood.
For example, imagine hat I create a 'Vector' class to do
basic linear algebra. Imagine that it works this way:
my @vec = Vector.new( 1,2,3,4 )
@vec * 3 # => ( 3,6,9,12 )
In other words, the
is way:
my @vec = Vector.new( 1,2,3,4 )
@vec * 3 # => ( 3,6,9,12 )
In other words, the '*' operator is overloaded to behave like scalar x
vector multiplication in linear algebra. I was thinking that it would
be neat if instead you could do this:
my Vector @vec;
@vec = 1,2,3,4;
@v
HaloO,
Yaakov Belch wrote:
I believe that ---from a usability point of view--- it's very important to:
* classify exceptions by "severity" or other characteristics,
* provide named adverbs/pragmas to modify default CATCH handlers,
* make them configurable by "outer scopes".
> [..]
The program
Thank you very much!
my $bill =
try ack() orelse
try thpp() orelse
do ppt();
This certainly does what I asked for, and it's short enough (even if we
need to add a few brackets).
Yes, the basic problem with the proposal is that it catches all
exceptions willy nilly and u
Yaakov Belch perl6-at-yaakovnet.net |Perl 6| wrote:
Let me explain why this is useful and why I think this is "the right thing":
First of all, it provides a very light-weight exception handling using
well-known ideoms like:
$file_content=read_file($filename) // $default_value;
compute_statist
C doesn't handle the type of exception thrown, should
: C be called immediately, or only if C. so how do i signify that my exception has been
: handled, and that i can now assign a default value to C<$bill>?
:
: in my mind, this strays too far from the meaning of C and adds
: ambigu
> in my mind, this strays too far from the meaning of C and adds
> ambiguity that makes the operator unusable. perhaps there's room for
> an operator that gives some sugar for
>
> my $bill = try { ack() CATCH { thpp() } };
>
> but to me that code is concise enou
On Wed, Aug 6, 2008 at 8:58 AM, Yaakov Belch <[EMAIL PROTECTED]> wrote:
> In a little language that I wrote some time ago, I found it very useful to
> let the // operator catch exceptions:
>
> f(x) // g(y) does:
> * If f(x) returns a defined value, use this value.
> * If f
In a little language that I wrote some time ago, I found it very useful to
let the // operator catch exceptions:
f(x) // g(y) does:
* If f(x) returns a defined value, use this value.
* If f(x) returns an undefined value, use the value of g(x) instead.
* If f(x) throws an exception, catch and keep
# New Ticket Created by Stephane Payrard
# Please include the string: [perl #53100]
# in the subject line of all future correspondence about this issue.
# http://rt.perl.org/rt3/Ticket/Display.html?id=53100 >
I will give it a try but does not promise anything.
--
cognominal stef
Did anybody notice that Larry has slipped in an anime smiley operator?
Between "^^" and the recent musing about "wa"...
On a closely related note, how long do you think it'll be before someone
puts this on CP6AN?
class n {
method n() is classmethod {# Or whatever it turns out to
36 matches
Mail list logo