The SF Perl Raku Study Group, 11/01 at 1pm PDT

2020-10-30 Thread Joseph Brenner
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:

Re: Constructing a number from digits in an arbitrary base

2020-10-30 Thread yary
> 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)

Re: Constructing a number from digits in an arbitrary base

2020-10-30 Thread Sean McAfee
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

Re: Constructing a number from digits in an arbitrary base

2020-10-30 Thread Bruce Gray
> 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

Re: Constructing a number from digits in an arbitrary base

2020-10-30 Thread Elizabeth Mattijsen
> 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

Re: Constructing a number from digits in an arbitrary base

2020-10-30 Thread Sean McAfee
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

Re: Constructing a number from digits in an arbitrary base

2020-10-30 Thread Elizabeth Mattijsen
$ 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

Constructing a number from digits in an arbitrary base

2020-10-30 Thread Sean McAfee
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,

Re: Metamodel parent and return values ...

2020-10-30 Thread Paul Procacci
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. > > > >

Re: Metamodel parent and return values ...

2020-10-30 Thread Timo Paulssen
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

Metamodel parent and return values ...

2020-10-30 Thread Paul Procacci
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