Looks like it worth a bug report. I was probably stumbling upon this too for a
couple of times.
Best regards,
Vadim Belman
> On Aug 27, 2022, at 2:24 AM, Fernando Santagata
> wrote:
>
> Hello,
> I noticed this behavior:
>
> [0] > my @a =
> [a b c d e]
> [1] > .say with $_ for @a
> ()
>
Heads-up: code was correct in my last post, but the output is as follows
(Rakudo v2021.06):
~$ raku -e '++(my %digraphs){$_} for slurp.lc.match(:global, :exhaustive,
/<[a..z]>**2/); .say for %digraphs.sort(-*.value);' richard3.txt
or => 4
rs => 3
ho => 3
se => 3
gd => 1
in => 1
fo => 1
om => 1
do
Hi Marc (and Bruce)!
I'm adapting a "word frequency" answer posted by Sean McAfee on this list.
The key seems to be adding the `:exhaustive` adverb to the `match` call.
AFAIK comb will not accept this adverb, so `match will have to do for now:
Sample Input (including quotes): “A horse, a horse,
> On Aug 27, 2022, at 10:56 AM, Marc Chantreux wrote:
--snip--
> but I think it is possible to move the cursor backward in the comb regex.
--snip--
I do *not* think you can ("move the cursor backward in the comb regex"); See
https://docs.raku.org/routine/comb :
... "returns a Seq
hello people,
Here is a little raku code to count all the digraphs from some text:
my %digraphs =
slurp.lc
.comb(/<[a..z]>+/)
.map( *.comb.rotor( 2 => -1, :!partial ).map: *.join )
.Bag;
The first .comb match words then I map them to get digraphs but I
Hello,
I noticed this behavior:
[0] > my @a =
[a b c d e]
[1] > .say with $_ for @a
()
[2] > .say if .defined for @a
a
b
c
d
e
[3] > (.say with $_) for @a
a
b
c
d
e
[4] > (.say if .defined) for @a
a
b
c
d
e
Apparently in this case "with" works only as a statement modifier while
"if" works both
cf https://github.com/rakudo/rakudo/issues/1985
On Wed, Aug 24, 2022 at 2:47 AM Kevin Pye wrote:
>
> Hi,
>
> The following fairly simple code works well:
>
>class A {
> has num $!a is required is built;
> };
>
> dd A.new(a => 1e0);
>
> producing "A.new(a => 1e0)".
>
> However, if
That makes some reasonable sense. I guess "is required" and native attributes
are more-or-less incompatible.
Kevin.
On Wed, 24 Aug 2022, at 12:45, William Michels via perl6-users wrote:
> It seems to work okay if I change `num` to `Num`:
>
> class A {
> has Num $!a is required is built;
>
It seems to work okay if I change `num` to `Num`:
class A {
has Num $!a is required is built;
};
dd A.new(a => 0e0);
#returns:
A.new(a => 0e0)
Note, I'm on a fairly old version of Rakudo [moar (2021.06).
HTH, Bill.
On Tue, Aug 23, 2022 at 6:47 PM Kevin Pye wrote:
>
> Hi,
>
>
Hi,
The following fairly simple code works well:
class A {
has num $!a is required is built;
};
dd A.new(a => 1e0);
producing "A.new(a => 1e0)".
However, if we make a slight change:
class A {
has num $!a is required is built;
};
dd A.new(a => 0e0);
(i.e.
"Look out honey, 'cause I'm using technology
Ain't got time to make no apology"
-- Iggy Pop, "Search and Destroy" (1973)
The Raku Study Group
August 21, 2022 1pm in California, 9pm in the UK, 4am in Bali
Zoom meeting link:
> On 9 Aug 2022, at 15:10, Fernando Santagata wrote:
>
> On Tue, Aug 9, 2022 at 2:13 PM Elizabeth Mattijsen wrote:
> > On 9 Aug 2022, at 13:53, Fernando Santagata
> > wrote:
> >
> > Hello,
> >
> > I'm trying to uninstall old versions of some modules; it looks like it's
> > working but
On Tue, Aug 9, 2022 at 2:13 PM Elizabeth Mattijsen wrote:
> > On 9 Aug 2022, at 13:53, Fernando Santagata
> wrote:
> >
> > Hello,
> >
> > I'm trying to uninstall old versions of some modules; it looks like it's
> working but in reality it isn't. For example, but it's not limited to just
> this
> On 9 Aug 2022, at 13:53, Fernando Santagata wrote:
>
> Hello,
>
> I'm trying to uninstall old versions of some modules; it looks like it's
> working but in reality it isn't. For example, but it's not limited to just
> this module:
>
> $ zef list --installed|grep CBOR
> ===> Found via
Hello,
I'm trying to uninstall old versions of some modules; it looks like it's
working but in reality it isn't. For example, but it's not limited to just
this module:
$ zef list --installed|grep CBOR
===> Found via /opt/rakudo-pkg/share/perl6/core
===> Found via /home/nando/.raku
On 8/9/22 03:09, Elizabeth Mattijsen wrote:
Good chance it will if:
a. that works in plain Perl
b. you have Inline::Perl5 installed
c. you do "use Net::FTP:from"
d. you change -> to .
Thank you!
I always had fit trying to understand Perl 5's OOP
and a lot of guys tried to get me to use it.
Good chance it will if:
a. that works in plain Perl
b. you have Inline::Perl5 installed
c. you do "use Net::FTP:from"
d. you change -> to .
> On 9 Aug 2022, at 11:46, ToddAndMargo via perl6-users
> wrote:
>
> On 8/9/22 00:56, Elizabeth Mattijsen wrote:
>>> On 9 Aug 2022, at 09:24,
On 8/9/22 00:56, Elizabeth Mattijsen wrote:
On 9 Aug 2022, at 09:24, ToddAndMargo via perl6-users
wrote:
On 9 Aug 2022, at 06:19, ToddAndMargo via perl6-users
wrote:
$ raku -Msigpipe -e 'loop { say "y"}' | sed 3q
===SORRY!=== Error while compiling -e
Could not find sigpipe in:
On 8/9/22 00:56, Elizabeth Mattijsen wrote:
On 9 Aug 2022, at 09:24, ToddAndMargo via perl6-users
wrote:
On 9 Aug 2022, at 06:19, ToddAndMargo via perl6-users
wrote:
$ raku -Msigpipe -e 'loop { say "y"}' | sed 3q
===SORRY!=== Error while compiling -e
Could not find sigpipe in:
> On 9 Aug 2022, at 09:24, ToddAndMargo via perl6-users
> wrote:
>>> On 9 Aug 2022, at 06:19, ToddAndMargo via perl6-users
>>> wrote:
>>>
>>> $ raku -Msigpipe -e 'loop { say "y"}' | sed 3q
>>> ===SORRY!=== Error while compiling -e
>>> Could not find sigpipe in:
>>>/home/tony/.raku
>>>
On 9 Aug 2022, at 06:19, ToddAndMargo via perl6-users
wrote:
$ raku -Msigpipe -e 'loop { say "y"}' | sed 3q
===SORRY!=== Error while compiling -e
Could not find sigpipe in:
/home/tony/.raku
/opt/rakudo-pkg/share/perl6/site
/opt/rakudo-pkg/share/perl6/vendor
So that you can transparently say "use DBI:from"
> On 9 Aug 2022, at 06:19, ToddAndMargo via perl6-users
> wrote:
>
> $ raku -Msigpipe -e 'loop { say "y"}' | sed 3q
> ===SORRY!=== Error while compiling -e
> Could not find sigpipe in:
>/home/tony/.raku
>/opt/rakudo-pkg/share/perl6/site
$ raku -Msigpipe -e 'loop { say "y"}' | sed 3q
===SORRY!=== Error while compiling -e
Could not find sigpipe in:
/home/tony/.raku
/opt/rakudo-pkg/share/perl6/site
/opt/rakudo-pkg/share/perl6/vendor
/opt/rakudo-pkg/share/perl6/core
CompUnit::Repository::AbsolutePath<71837872>
hello Rakoons,
I found the sigpipe module [S13] while reading the Rakudo Weekly
news[rwn] so Raku can handle SIGPIPE the way I think is the good one:
raku -e 'loop { say "y"}' | sed 3q
# some weird error
raku -Msigpipe -e 'loop { say "y"}' | sed 3q
# just works
Walt Whitman, "Democratic Vistas" (1871):
"... ahead, though dimly yet, we see, in vistas,
a copious, sane, gigantic offspring."
The Raku Study Group
August 7, 2022 1pm in California, 9pm in the UK
Zoom meeting link:
Hi Liz!
> sub prefix:<`>(*@a) { (run @a, :out).out.lines }
Thanks for this example, I now can write things like
.say for grep / '.txt' $ /, `
for ` { .say if / '.txt' $ / }
which made me remember I wrote something similar (but not working) for
the FOSDEM talk:
sub
> On 4 Aug 2022, at 14:38, Marc Chantreux wrote:
> It would be nice to define a backtrick operator (like in rc) so we
> could write
>
> my @installed-files =
> grep *.IO.f,
> map *.trim,
> `< dpkg-query -f ${db-fsys:Files} -W gnuplot* >;
>
>
hello Liz and thanks for helping,
> I believe you could use App::Rak for that:
> $ zef install App::Rak
I'll test rak at some point but in this case, I can just write
dpkg-query -f \${db-fsys:Files} -W gnuplot\* |
raku -pe '.=trim; .say if .trim.IO.f'
I asked the question
Hi Brian and thanks for your reply.
> There is the 'x' adverb for Q -- I think qx is equivalent to Q:x
exactly. that's why Q:x doesn't help as it still run sh -c to execute
the command.
regards,
--
Marc Chantreux
Pôle de Calcul et Services Avancés à la Recherche (CESAR)
On Thursday, August 4, Marc Chantreux wrote:
> I read the Proc documentation and tried to see if there was another
> command or an adverb to the qx construction (something like :r for run).
There is the 'x' adverb for Q -- I think qx is equivalent to Q:x
https://docs.raku.org/syntax/Q
Brian
> On 4 Aug 2022, at 10:35, Marc Chantreux wrote:
>
> hello people,
>
> I found myself choosing between
>
> raku -e '
> (run :out, <
> dpkg-query -f ${db-fsys:Files} -W gnuplot*
> > ).out>>.lines>>.trim>>.grep(*.IO.f)>>.say'
>
> and
>
> raku -e '
> qx<
>
Sorry this list is for users of the programming language Raku, which
was formerly known as "Perl 6".
For Perl support, I'd recommend starting at https://www.perl.org/
Best of luck.
On Mon, Aug 1, 2022 at 4:16 AM Turritopsis Dohrnii Teo En Ming
wrote:
>
> Subject: Virtualmin and Webmin web
Subject: Virtualmin and Webmin web hosting control panel are written in Perl 5
Good day from Singapore,
I understand that Virtualmin and Webmin web hosting control panel are
written in Perl 5.
Source: In which perl framework is webmin written into?
Link:
"Coevolution and symbiosis are fundamentally about relationships, and
those change over time. A pet rat, a lab rat, a plague of rats and
rats of unusual size all have different relationships with human
beings, but they're all rats, and we're all humans."
Frank Landis, "Hot Earth Dreams" (2016)
On 7/19/22 12:00, Elizabeth Mattijsen wrote:
Could it be that you have a "Foo.pm" in an "earlier" directory and a "Foo.pm6"
in a later directory in the $*REPO chain?
Hi Elizabeth,
p6 'say $*REPO'
inst#/home/todd/.raku
I do not add my modules to the chain as I am
ALWAYS tweaking them.
I put
> On 19 Jul 2022, at 20:49, ToddAndMargo via perl6-users
> wrote:
> As an aside, Raku still reads my Perl 5 ".pm"
> modules before reading my Raku ".pm6" modules.
> Raku default to ".pm" before ".pm6". The
> compiler wags its finger at me a lot!
>
> So I have to segregate my ".pm6" modules
>
On 7/19/22 11:13, Richard Hainsworth wrote:
pm6 -> rakumod.
Hi Richard,
+1 on Richards naming scheme.
As an aside, Raku still reads my Perl 5 ".pm"
modules before reading my Raku ".pm6" modules.
Raku default to ".pm" before ".pm6". The
compiler wags its finger at me a lot!
So I have to
With the change from Perl 6 to Raku, there were a number of naming
changes, particularly of file formats, eg pl6 -> raku, pm6 -> rakumod.
One of the changes was `.pod6` to `.rakudoc` for files that are
primarily documentation files.
However, we continue to refer to POD6 (also known as Pod6)
That is correct.
> On 12 Jul 2022, at 03:52, Darren Duncan wrote:
>
> On 2022-07-10 10:56 a.m., Elizabeth Mattijsen wrote:
>> Fez (aka https://360.zef.pm) will provide *all* versions.
>
> The above url just displays a big data structure when visiting it in a web
> browser, and not a normal
On 2022-07-10 10:56 a.m., Elizabeth Mattijsen wrote:
Fez (aka https://360.zef.pm) will provide *all* versions.
The above url just displays a big data structure when visiting it in a web
browser, and not a normal website, is that correct? -- Darren Duncan
Vadim and Liz,
Thank you for this clue.
I seem to be behind on this. I do not use App::Mi6
I try to keep to the documentation on Modules.pod6, and I have updated
Modules.pod6 every time I learn something more.
It seems to me that there should be some more explanation in
Modules.pod6 for
Ah, indeed I did. Using App::Mi6 is so ingrained in me (and before that
"cpan-upload"), that it is hard for me to imagine any other situation :-)
Liz
> On 10 Jul 2022, at 21:41, Vadim Belman wrote:
>
> Hi,
>
> Liz has probably missed the point of your question. Yes, you must do fez
>
Hi,
Liz has probably missed the point of your question. Yes, you must do fez upload
for each new release. It means each time you'd need to do some pre-release
preparations to create an archive, etc... The fastest way is to switch to
App::Mi6 for building distributions. My approach is a
"The sciences, even the best,-- mathematics and astronomy,--
are like sportsmen, who seize whatever prey offers, even
without being able to make any use of it."
--Ralph Waldo Emerson, "Plato, or, the Philosopher"
The Raku Study Group
July 10, 2022 1pm in California, 9pm in the
Hi all,
On Wed, Jul 06, 2022 at 08:44:02PM -0700, William Michels via perl6-users wrote:
> I'm assuming the `%` is the anonymous state variable (associative)?
> https://docs.raku.org/language/variables#The_%_variable
Thanks, Bill, that is a significant bit (Ha, I'll keep that to punish
On 7/6/22 19:54, rir wrote:
I don't know what the free-standing '%' means;
Me either.
If this is your first time using associated
arrays (hashes), this is my Keeper on the
subject,
HTH,
-T
12/08/2019:
Perl 6 Hashes (associative arrays):
References:
I'm assuming the `%` is the anonymous state variable (associative)?
https://docs.raku.org/language/variables#The_%_variable
Best guess for now, Bill.
On Wed, Jul 6, 2022 at 8:10 PM rir wrote:
>
> Hi,
> Sorry, my previous message got away from me a little to soon.
> I'll stand by it without
Hi,
Sorry, my previous message got away from me a little to soon.
I'll stand by it without the last partial sentence,
and, more important, the addition of a greeting and
some good will.
Thanks,
Rob
On Wed, Jul 06, 2022 at 10:54:11PM -0400, rir wrote:
>
> This is sharing a 'What?!!' moment and
This is sharing a 'What?!!' moment and some aftermath with the
hope of some reduction of ignorance.
This is from some code I found:
say my %h = % = %(:a(1)); # OUTPUT: «{a => 1}»
All whitespace after the identifier is optional--not changing the
assignment.
Reduced further:
On Fri, Jul 1, 2022 at 8:10 PM ToddAndMargo via perl6-users
wrote:
On Fri, Jul 1, 2022 at 7:34 PM ToddAndMargo via perl6-users
mailto:perl6-users@perl.org>> wrote:
Hi All,
Windows 10 Pro - 21H2
RakudoMoar-2022.06.01-win-x86_64-msvc.msi
> raku -v
Welcome to
https://www.reddit.com/r/rakulang/comments/kko35z/short_blog_post_fixing_raku_unicode_display/
To enable unicode output in your cmd session, run:
chcp 65001
On Fri, Jul 1, 2022 at 8:10 PM ToddAndMargo via perl6-users
wrote:
>
> >> On Fri, Jul 1, 2022 at 7:34 PM ToddAndMargo via perl6-users
>
hello,
> Is this a bug, or are my (our?) expectations wrong?
I posted on the list precisely because the doc. wasn't
enough to GTD so I can't reply your question :)
regards
--
Marc Chantreux
Direction du numérique de l'Université de Strasbourg
Pôle de Calcul et Services Avancés à la Recherche
Ralph,
On Sat, Jul 02, 2022 at 08:27:19PM +0100, Ralph Mellor wrote:
> Does this do what you want:
> BEGIN my (@o, @f) = 0 xx 3;
> @o.push: "ok";
> say @o;
>
seq 2|raku -ne '
BEGIN my (@o, @f) = 0 xx 3;
@o.push: "ok";
say @o;
'
works fine! thank you
On 2022-07-02 Marc Chantreux wrote:
> AFAIK about raku -n, I need 2 lines to setup a
> state with a default value
>
> seq 2| raku -ne '
> state (@o, @f);
> BEGIN @o = 0 xx 3;
> @o.push: "ok";
> say @o;
> '
>
> but is there a
On Sat, Jul 2, 2022 at 5:26 PM Marc Chantreux wrote:
>
> AFAIK about raku -n, I need 2 lines to setup a state with a default value
Does this do what you want:
BEGIN my (@o, @f) = 0 xx 3;
@o.push: "ok";
say @o;
?
love, raiph
hello rakoons,
AFAIK about raku -n, I need 2 lines to setup a
state with a default value
seq 2| raku -ne '
state (@o, @f);
BEGIN @o = 0 xx 3;
@o.push: "ok";
say @o;
'
but is there a shorter way ?
regards,
marc
Technically speaking, it's mojibake.
Larry
On Fri, Jul 1, 2022 at 7:34 PM ToddAndMargo via perl6-users <
perl6-users@perl.org> wrote:
> Hi All,
>
> Windows 10 Pro - 21H2
> RakudoMoar-2022.06.01-win-x86_64-msvc.msi
>
> > raku -v
> Welcome to RakudoΓäó v2022.06.
> Implementing the Raku®
Hi All,
Due to Google's decision to drop what they
call "less secure apps" (they are not with a
hard password):
https://support.google.com/accounts/answer/6010255?hl=en#zippy=%2Cif-less-secure-app-access-is-on-for-your-account
Most of my customer are using gMail and g-suite,
which is also
On Fri, Jul 1, 2022 at 7:34 PM ToddAndMargo via perl6-users
mailto:perl6-users@perl.org>> wrote:
Hi All,
Windows 10 Pro - 21H2
RakudoMoar-2022.06.01-win-x86_64-msvc.msi
> raku -v
Welcome to RakudoΓäó v2022.06.
Implementing the Raku® Programming Language v6.d.
On Sat, 2 Jul 2022, at 09:34, ToddAndMargo via perl6-users wrote:
Hi All,
Windows 10 Pro - 21H2
RakudoMoar-2022.06.01-win-x86_64-msvc.msi
> raku -v
Welcome to RakudoΓäó v2022.06.
Implementing the Raku® Programming Language v6.d.
Built on MoarVM version 2022.06.
What is `Γäó`?
Inquiring
You need a Unicode terminal.
It's a trademark symbol.
(And the bit following "Raku" on the next line is a "registered mark" symbol.)
Kevin.
On Sat, 2 Jul 2022, at 09:34, ToddAndMargo via perl6-users wrote:
> Hi All,
>
> Windows 10 Pro - 21H2
> RakudoMoar-2022.06.01-win-x86_64-msvc.msi
>
> >
Hi All,
Windows 10 Pro - 21H2
RakudoMoar-2022.06.01-win-x86_64-msvc.msi
> raku -v
Welcome to RakudoΓäó v2022.06.
Implementing the Raku® Programming Language v6.d.
Built on MoarVM version 2022.06.
What is `Γäó`?
Inquiring minds want to know.
-T
--
~~
Upgraded! Thank you Richard!
admin@mbook:~$ ~/rakudo/rakudo-2021.06/zef/bin/zef upgrade Raku::Pod::Render
^[[A===> Searching for: Raku::Pod::Render
===> Updating fez mirror: http://360.zef.pm/
===> Updating cpan mirror:
https://raw.githubusercontent.com/ugexe/Perl6-ecosystems/master/cpan1.json
The problem is cured by uploading the latest version of the dependent
module to fez.
A `zef search Raku::Pod::Render` should list v3.7.6
On 29/06/2022 3:11 pm, Fernando Santagata wrote:
Hi Richard,
I tried 'zef search Raku::Pod::Render' and I can only see versions
from v2.1 through v3.7.3.
How long ago v3.7.5 has been uploaded to p6c? Is p6c enabled in zef
configuration?
And it would be much better and more reliable to migrate to zef/fez ecosystem
already. :)
Best regards,
Vadim Belman
> On Jun 29, 2022, at 8:49 AM, Richard Hainsworth
> wrote:
>
> Hi,
>
> zef appears to be
Hi Richard,
I tried 'zef search Raku::Pod::Render' and I can only see versions from
v2.1 through v3.7.3.
If your last version is v3.7.5 there's something missing for sure.
On Wed, Jun 29, 2022 at 2:50 PM Richard Hainsworth
wrote:
> Hi,
>
> zef appears to be giving inconsistent results.
>
> I
Hi,
zef appears to be giving inconsistent results.
I have updated several of my modules. But when I try the github actions
to test an update a module that depends on one updated, it does not
recognise the most recent module, only a version I changed some time ago.
I have a module called
At the last Raku Study Group (Meetup), Joseph brought up an issue he's
noticed with Raku's capture markers, `<(`...`)>`.
Just noting here (for posterity) that the SO issue below might be an
identical--or related--observation:
On 6/20/22 00:36, William Michels wrote:
On Sun, Jun 19, 2022 at 11:00 PM ToddAndMargo via perl6-users
mailto:perl6-users@perl.org>> wrote:
On 6/19/22 21:49, William Michels via perl6-users wrote:
> Hi Todd, I'm trying to follow what you're doing (below in
Terminal app
>
On 6/19/22 23:11, Kevin Pye wrote:
On Mon, 20 Jun 2022, at 15:59, ToddAndMargo via perl6-users wrote:
I had to use "utf8-c8" to keep the line
from crashing.
Well, any of "iso-8859-1" (or "latin-1"), "windows-1251", "windows-1252" or
"windows-932" would also have failed to crash. In fact
On Sun, Jun 19, 2022 at 11:00 PM ToddAndMargo via perl6-users <
perl6-users@perl.org> wrote:
> On 6/19/22 21:49, William Michels via perl6-users wrote:
> > Hi Todd, I'm trying to follow what you're doing (below in Terminal app
> > on MacOS):
> >
> > ~$ raku
> > Welcome to 퐑퐚퐤퐮퐝퐨™ v2021.06.
> >
On 6/19/22 21:49, William Michels via perl6-users wrote:
Hi Todd, I'm trying to follow what you're doing (below in Terminal app
on MacOS):
~$ raku
Welcome to 퐑퐚퐤퐮퐝퐨™ v2021.06.
Implementing the 퐑퐚퐤퐮™ programming language v6.d.
Built on MoarVM version 2021.06.
To exit type 'exit' or '^D'
>
Hi Todd, I'm trying to follow what you're doing (below in Terminal app on
MacOS):
~$ raku
Welcome to 퐑퐚퐤퐮퐝퐨™ v2021.06.
Implementing the 퐑퐚퐤퐮™ programming language v6.d.
Built on MoarVM version 2021.06.
To exit type 'exit' or '^D'
> print Buf.new(0x84, 0x73, 0x77, 0x84, 0x79).decode("utf8-c8") ~
>print Buf.new(0x84, 0x73, 0x77, 0x84, 0x79).decode("utf8-c8") ~ "\n"
�x84sw�x84y
On 6/19/22 02:30, William Michels via perl6-users wrote:
On Sun, Jun 19, 2022 at 2:16 AM ToddAndMargo via perl6-users
wrote:
On 6/19/22 02:14, ToddAndMargo via perl6-users wrote:
On Sun, Jun 19, 2022 at 12:55 AM ToddAndMargo via perl6-users
wrote:
Hi All,
Hi All,
If you were wondering what I was up to, this is it.
This is originally in Open Document Test (.odt) format,
so I do not know how well it will translate to text.
If you want the original document, I will email it
to you. It is a lot pretties and you can
on the Table of Contents to jump
On 6/19/22 03:06, ToddAndMargo via perl6-users wrote:
On 6/19/22 00:33, ToddAndMargo via perl6-users wrote:
Hi All,
I have a string:
> my Str $x = "1BB67AE85A";
1BB67AE85A
which has the hexadecimal values I want to
add to a buffer:
> my buf8 $y = buf8.new($x.base(16));
No such method
On 6/19/22 00:33, ToddAndMargo via perl6-users wrote:
Hi All,
I have a string:
> my Str $x = "1BB67AE85A";
1BB67AE85A
which has the hexadecimal values I want to
add to a buffer:
> my buf8 $y = buf8.new($x.base(16));
No such method 'base' for invocant of type 'Str'. Did you mean any of
On 6/19/22 00:33, ToddAndMargo via perl6-users wrote:
Hi All,
I have a string:
> my Str $x = "1BB67AE85A";
1BB67AE85A
which has the hexadecimal values I want to
add to a buffer:
> my buf8 $y = buf8.new($x.base(16));
No such method 'base' for invocant of type 'Str'. Did you mean any of
On Sun, Jun 19, 2022 at 2:16 AM ToddAndMargo via perl6-users
wrote:
>
> On 6/19/22 02:14, ToddAndMargo via perl6-users wrote:
> >
> >> On Sun, Jun 19, 2022 at 12:55 AM ToddAndMargo via perl6-users
> >> wrote:
> >>>
> >>> Hi All,
> >>>
> >>> https://docs.raku.org/routine/encode
> >>>
> >>> multi
On 6/19/22 02:14, ToddAndMargo via perl6-users wrote:
On Sun, Jun 19, 2022 at 12:55 AM ToddAndMargo via perl6-users
wrote:
Hi All,
https://docs.raku.org/routine/encode
multi method encode(Str:D $encoding = 'utf8', :$replacement, Bool()
:$translate-nl = False, :$strict)
shows "ascii" and
On Sun, Jun 19, 2022 at 12:55 AM ToddAndMargo via perl6-users
wrote:
Hi All,
https://docs.raku.org/routine/encode
multi method encode(Str:D $encoding = 'utf8', :$replacement, Bool()
:$translate-nl = False, :$strict)
shows "ascii" and "utf8" as possible values for
"$encoding".
I tool a
Hi Todd,
It's great that you've delved into the "encode" docs.
However to answer your question, I think you want to look at the
"encoding" routine page:
https://docs.raku.org/routine/encoding#class_IO::Handle
Here's the list on that page:
utf8
utf16
utf16le
utf16be
utf8-c8
iso-8859-1
Hi All,
https://docs.raku.org/routine/encode
multi method encode(Str:D $encoding = 'utf8', :$replacement, Bool()
:$translate-nl = False, :$strict)
shows "ascii" and "utf8" as possible values for
"$encoding".
I tool a guess and found out "utf16".
Where are the rest of the values
Hi All,
I have a string:
> my Str $x = "1BB67AE85A";
1BB67AE85A
which has the hexadecimal values I want to
add to a buffer:
> my buf8 $y = buf8.new($x.base(16));
No such method 'base' for invocant of type 'Str'. Did you mean any of
these: 'Bag', 'Date', 'Hash', 'are', 'asec', 'hash', 'take'?
Typo.
Should have been:
append to Buf question
And in my Keeper, I keep typing "bugger" instead
of "buffer". Can't win.
On 6/18/22 22:16, Bruce Gray wrote:
On Jun 18, 2022, at 10:42 PM, ToddAndMargo via perl6-users
wrote:
On 6/16/22 10:10, Rick Bychowski wrote:
sub MAIN($n = 20) {
.say for factors($n); # Nil
}
I thought `MAIN` was a reserved variable. Am
I missing something?
MAIN has a special
On 6/18/22 22:58, Bruce Gray wrote:
If all you want is to append 0xBB to $y, either of these will work:
$y ~= Buf.new(0xBB);
$y.append(0xBB);
Did not realize I could use buf new like that. Thank you!
Append numbers to a buffer:
> $x
Buf:0x<41 42 43 44>
> $x.append( 0xDD );
On 6/18/22 22:58, Bruce Gray wrote:
From just looking at your code, I am not clear on what you are trying to do.
I am updating my Keeper on buffers. I have four of them
that are a mess and I an going to consolidate them into
a single .ODT (open document text) file with an index.
> On Jun 18, 2022, at 11:13 PM, ToddAndMargo via perl6-users
> wrote:
>
> Hi All,
>
> What am I doing wrong here:
From just looking at your code, I am not clear on what you are trying to do.
> > my Buf $y = Buf.new( 0xFA xx 10);
> Buf:0x
>
> > $y ~= 0xBB.encode.Buf;
> Buf:0x
>
> I got
On 6/18/22 21:13, ToddAndMargo via perl6-users wrote:
Hi All,
What am I doing wrong here:
> my Buf $y = Buf.new( 0xFA xx 10);
Buf:0x
> $y ~= 0xBB.encode.Buf;
Buf:0x
I got three entries (31 38 37) instead of one (0xBB)
Some more goofing around:
> $y ~= 0xBB;
Stringification of a Buf is
On 6/18/22 22:12, ToddAndMargo via perl6-users wrote:
What am I doing wrong here too?
my $d = buf8.new( 0xDE..0xDB );
Buf[uint8]:0x<>
Not sure why the above did not work, but this does:
Presalt with swept entries:
> my buf8 $e = buf8.new(0x5..0x8);
Buf[uint8]:0x<05 06 07 08>
> my
> On Jun 18, 2022, at 10:42 PM, ToddAndMargo via perl6-users
> wrote:
>
> On 6/16/22 10:10, Rick Bychowski wrote:
>> sub MAIN($n = 20) {
>>.say for factors($n); # Nil
>> }
>
>
> I thought `MAIN` was a reserved variable. Am
> I missing something?
MAIN has a special meaning as a sub
What am I doing wrong here too?
my $d = buf8.new( 0xDE..0xDB );
Buf[uint8]:0x<>
--
~~
Computers are like air conditioners.
They malfunction when you open windows
~~
Hi All,
What am I doing wrong here:
> my Buf $y = Buf.new( 0xFA xx 10);
Buf:0x
> $y ~= 0xBB.encode.Buf;
Buf:0x
I got three entries (31 38 37) instead of one (0xBB)
Some more goofing around:
> $y ~= 0xBB;
Stringification of a Buf is not done with 'Str'. The 'decode' method
should be used
On 6/16/22 10:10, Rick Bychowski wrote:
sub MAIN($n = 20) {
.say for factors($n); # Nil
}
I thought `MAIN` was a reserved variable. Am
I missing something?
Clever!
I had missed checking "is-prime" straight away! Checked some large
primes, and my function hung badly. Thank you!
Is grep running on all "2 ..^ $n/2" values, and then picking the first,
or is that somehow lazily evaluated? I assume the former, or you'd have
no need to halve $n. But
Frederick P. Brooks, from the additional material in the 1995
edition of "The Mythical Man-Month" (1975):
"Much more is known today about software engineering than
was known in 1975. Which of the assertions in the original
1975 edition have been supported by data and experience?
Here's my new go to prime-factors function :
sub prime-factors( Int $n is copy where * > 1 ) {
gather {
while ( $n > 1 ) {
if ( $n.is-prime ) {
take $n;
last;
}
my $f = (2..^$n/2).grep($n %% *).first(*.is-prime);
This is because if there isn't an explicit return the last statement
evaluated is the implied return value.
So the last call (which returns Nil) was your implicit return.
Generally I try and avoid an implicit return if a function has more than a
couple of lines.
On Thu, 16 Jun 2022, 21:41 Rick
601 - 700 of 9469 matches
Mail list logo