Re: Different behavior for strings and strings in variables with multi-dispatch using a subset
> You overlooked a mistype. The subset expects "wuhn", you pass "whun" instead. > Guess, the subset is wrong about it. :) Yes indeed, that seems to be all it is. Thanks much. And maybe I'll go back to monster names in my demos. On 9/22/21, Vadim Belman wrote: > > You overlooked a mistype. The subset expects "wuhn", you pass "whun" > instead. Guess, the subset is wrong about it. :) > > Best regards, > Vadim Belman > >> On Sep 22, 2021, at 8:39 PM, Joseph Brenner wrote: >> >> In this code I'm using multi-dispatch with a subset type that >> makes string values special: "wuhn", "tew" and "thuree". >> >>use Test; >> >>multi sub whats_my_type (Str $item) { >>return "This is a Str: $item"; >>} >> >>subset GoofyNum of Str where { $_ eq any( 'wuhn', 'tew', 'thuree' ) }; >>multi sub whats_my_type (GoofyNum $item) { >>return "This is a GoofyNum string: $item"; >>} >> >>{ >>my ($ret, $arg); >>$ret = whats_my_type('two'); >>like $ret, /<< Str >>/, "quoted string argument of 'two' is Str"; >> >>$ret = whats_my_type('tew'); >>like $ret, /<< GoofyNum >>/, "quoted string argument of >> 'wuhn' is 'goofy'"; >> >>$arg = "one"; >>$ret = whats_my_type( $arg ); >>like $ret, /<< Str >>/, "string in var argument of '$arg' is Str"; >> >>$arg = "whun"; >>$ret = whats_my_type( $arg ); >>like $ret, /<< GoofyNum >>/, "string in var argument of 'wuhn' >> is 'goofy'"; >>} >> >> >> I would think all four of these tests should pass, instead I see >> the last one failing: for some reason there's a difference in the >> case of a simple quoted string, and a string inside a variable. >> >> Any comments? >> >> >> raku --version >> Welcome to 퐑퐚퐤퐮퐝퐨™ v2020.10. >> Implementing the 퐑퐚퐤퐮™ programming language v6.d. >> Built on MoarVM version 2020.10. >> >> uname -a >> Linux fandango 4.9.0-8-686 #1 SMP Debian 4.9.144-3 (2019-02-02) i686 >> GNU/Linux >> > >
The SF Perl Raku Study Group, 09/26 at 1pm PDT
E.K. Rand, "Founders of the Middle Ages" (1928): You begin to remove accretions, you peel and peel, till nothing is left-- nothing but the knife, the own peculiar knife, of the peeler. The Raku Study Group September 26, 2021 1pm in California, 8pm in the UK Zoom meeting link: https://us02web.zoom.us/j/84405232275?pwd=cFNnaXFQODJIdUYwV2pLT3kzMlIwUT09 Passcode: 4RakuRoll RSVPs are useful, though not needed: https://www.meetup.com/San-Francisco-Perl/events/280953141/
Re: Different behavior for strings and strings in variables with multi-dispatch using a subset
You overlooked a mistype. The subset expects "wuhn", you pass "whun" instead. Guess, the subset is wrong about it. :) Best regards, Vadim Belman > On Sep 22, 2021, at 8:39 PM, Joseph Brenner wrote: > > In this code I'm using multi-dispatch with a subset type that > makes string values special: "wuhn", "tew" and "thuree". > >use Test; > >multi sub whats_my_type (Str $item) { >return "This is a Str: $item"; >} > >subset GoofyNum of Str where { $_ eq any( 'wuhn', 'tew', 'thuree' ) }; >multi sub whats_my_type (GoofyNum $item) { >return "This is a GoofyNum string: $item"; >} > >{ >my ($ret, $arg); >$ret = whats_my_type('two'); >like $ret, /<< Str >>/, "quoted string argument of 'two' is Str"; > >$ret = whats_my_type('tew'); >like $ret, /<< GoofyNum >>/, "quoted string argument of > 'wuhn' is 'goofy'"; > >$arg = "one"; >$ret = whats_my_type( $arg ); >like $ret, /<< Str >>/, "string in var argument of '$arg' is Str"; > >$arg = "whun"; >$ret = whats_my_type( $arg ); >like $ret, /<< GoofyNum >>/, "string in var argument of 'wuhn' > is 'goofy'"; >} > > > I would think all four of these tests should pass, instead I see > the last one failing: for some reason there's a difference in the > case of a simple quoted string, and a string inside a variable. > > Any comments? > > > raku --version > Welcome to 퐑퐚퐤퐮퐝퐨™ v2020.10. > Implementing the 퐑퐚퐤퐮™ programming language v6.d. > Built on MoarVM version 2020.10. > > uname -a > Linux fandango 4.9.0-8-686 #1 SMP Debian 4.9.144-3 (2019-02-02) i686 GNU/Linux >
Different behavior for strings and strings in variables with multi-dispatch using a subset
In this code I'm using multi-dispatch with a subset type that makes string values special: "wuhn", "tew" and "thuree". use Test; multi sub whats_my_type (Str $item) { return "This is a Str: $item"; } subset GoofyNum of Str where { $_ eq any( 'wuhn', 'tew', 'thuree' ) }; multi sub whats_my_type (GoofyNum $item) { return "This is a GoofyNum string: $item"; } { my ($ret, $arg); $ret = whats_my_type('two'); like $ret, /<< Str >>/, "quoted string argument of 'two' is Str"; $ret = whats_my_type('tew'); like $ret, /<< GoofyNum >>/, "quoted string argument of 'wuhn' is 'goofy'"; $arg = "one"; $ret = whats_my_type( $arg ); like $ret, /<< Str >>/, "string in var argument of '$arg' is Str"; $arg = "whun"; $ret = whats_my_type( $arg ); like $ret, /<< GoofyNum >>/, "string in var argument of 'wuhn' is 'goofy'"; } I would think all four of these tests should pass, instead I see the last one failing: for some reason there's a difference in the case of a simple quoted string, and a string inside a variable. Any comments? raku --version Welcome to 퐑퐚퐤퐮퐝퐨™ v2020.10. Implementing the 퐑퐚퐤퐮™ programming language v6.d. Built on MoarVM version 2020.10. uname -a Linux fandango 4.9.0-8-686 #1 SMP Debian 4.9.144-3 (2019-02-02) i686 GNU/Linux
Re: Rakudo-Star 2021.09 (Windows MSI and Linux RSTAR) packages
Thank you, Anton! On Wed, Sep 22, 2021 at 11:57 AM wrote: > > Hi all. > > Who ever is interested in a Rakudo-Star "latest" Windows MSI or Linux RSTAR > package... you may want to get 2021.09 from here [1]. > Please be aware that the Linux RSTAR package changed a bit compared to its > "origin" in [4] > > The previous Windows MSI build under [3] is also updated to 2021.09... just > in case someone was using this repo and it's versions somewhere. > Midterm I plan to "discontinue" [3] and send pulls to merge [1] into [4] > @RakudoDevs: feel free to comment on the changes I made in [1] > > > @Patrick, feel free to copy packages from [1] to [2] again... > > > Regards > AntonOks > > [1]: https://github.com/AntonOks/star/releases/latest > [2]: https://rakudo.org/latest/star/win > [3]: https://github.com/AntonOks/rakudo-star-win/releases > [4]: https://github.com/rakudo/star > >
Rakudo-Star 2021.09 (Windows MSI and Linux RSTAR) packages
Hi all. Who ever is interested in a Rakudo-Star "latest" Windows MSI or Linux RSTAR package... you may want to get 2021.09 from here [1]. Please be aware that the Linux RSTAR package changed a bit compared to its "origin" in [4] The previous Windows MSI build under [3] is also updated to 2021.09... just in case someone was using this repo and it's versions somewhere. Midterm I plan to "discontinue" [3] and send pulls to merge [1] into [4] @RakudoDevs: feel free to comment on the changes I made in [1] @Patrick, feel free to copy packages from [1] to [2] again... Regards AntonOks [1]: https://github.com/AntonOks/star/releases/latest [2]: https://rakudo.org/latest/star/win [3]: https://github.com/AntonOks/rakudo-star-win/releases [4]: https://github.com/rakudo/star