Defining classes outside of raku
I'm designing a program that would be easiest to have classes created at
runtime.
I've been reading the following page:
https://docs.raku.org/type/Metamodel::ClassHOW
While I believe creating the class itself is working, I'm unsure where it's
documented abou
On 30/10/2020 07:58, Paul Procacci wrote:
Here is what I have ... trimmed.
#
use JSON::Pretty;
use Staticish;
unit class MyClass is Static;
method client(::?CLASS:D: Str:D $service! --> MyClass)
{
my %data := from-json %?R
Well I feel dumb. I haven't tried it yet, but that makes sense. It's what
I get for working on this in the w hours of the morning.
Thanks,
Paul
On Fri, Oct 30, 2020 at 7:48 AM Timo Paulssen wrote:
> On 30/10/2020 07:58, Paul Procacci wrote:
> > Here is what I have ... trimmed.
> >
> > ###
I want to construct a number from its digits in some arbitrary base. That
is, to essentially do the inverse of this kind of polymod call:
my @digits = $number.polymod($base xx *);
I have a nagging feeling that I've seen a very concise way to do this in
Raku before, but now it escapes me, and
$ raku -e 'dd "g".parse-base(17)'
16
> On 30 Oct 2020, at 21:25, Sean McAfee wrote:
>
> I want to construct a number from its digits in some arbitrary base. That
> is, to essentially do the inverse of this kind of polymod call:
>
> my @digits = $number.polymod($base xx *);
>
> I have a n
Sorry, it seems I wasn't explicit enough.
With polymod, I can get the values of digits even in large bases like 101:
> 1234567890.polymod(101 xx *)
(46 20 26 87 11)
Given a list of digit values like that, and the base, I want to reconstruct
the original number. One way would be the one
> On 30 Oct 2020, at 22:11, Sean McAfee wrote:
>
> Sorry, it seems I wasn't explicit enough.
>
> With polymod, I can get the values of digits even in large bases like 101:
>
> > 1234567890.polymod(101 xx *)
> (46 20 26 87 11)
>
> Given a list of digit values like that, and the base, I
> On Oct 30, 2020, at 3:25 PM, Sean McAfee wrote:
>
> I want to construct a number from its digits in some arbitrary base. That
> is, to essentially do the inverse of this kind of polymod call:
>
> my @digits = $number.polymod($base xx *);
>
> I have a nagging feeling that I've seen a
On Fri, Oct 30, 2020 at 2:19 PM Elizabeth Mattijsen wrote:
> > On 30 Oct 2020, at 22:11, Sean McAfee wrote:
> > > sum <46 20 26 87 11> Z* (1, * * 101 ... *)
> > 123456789
> >
> > ...but I'm hoping there's something more concise, shorter, and/or
> readable.
>
> Ah, so it's not about parsi
> So you'd basically need a sub that takes a List, and a base factor, and
does the necessary arithmetic for you. I don't think that's in core.
If that were to exist, would that be an inverse of "polymod"- maybe
"polymul"? - with this property
@decomposed-num = $some_number.polymod(@a-sequence)
i
And one more time (with a corrected meetup link this time):
"Man or Child, Stong or Weak, None of those matter
once you are out at sea!" -- Usopp ("One Piece")
The Raku Study Group.
November 1st, 1pm in California, 9pm in the UK
Zoom meeting link:
https://us02web.zoom.us/j/84566910601?pwd=R0pp
11 matches
Mail list logo