In case you had not heard, Raku content will (unsurprisingly) be part of The
Perl and Raku Conference, June 24th through 28th in Las Vegas.
(Come to think of it, if you hadn't heard about this conference *at* *all*, and
you are a Raku user, please email me personally, so we will know i
compiling:
Undeclared name:
_ used at line 1
[5] > dd :_:
No such method 'dd' for invocant of type 'Pair'
in block at line 1
On Sep 24, 2023, at 23:40, Polgár Márton
wrote:
Hi Bill,
:_ is a Pair with the colon syntax that stands for "_" => True
No such method 'dd' for invocant of type 'Pair'
in block at line 1
> On Sep 24, 2023, at 23:40, Polgár Márton
> wrote:
>
> Hi Bill,
>
> :_ is a Pair with the colon syntax that stands for "_" => True. In the first
> case, it got pa
Hi Bill,
:_ is a Pair with the colon syntax that stands for "_" => True. In the first
case, it got passed as a named argument and say ignored it. The second case was
a method call using the colon syntax - the syntax lizmat challenged not so long
ago. https://github.com/Raku/pr
Hello,
While playing around in an attempt to define new operators, I stumbled upon
some curious results.
In the REPL, trying `say :_` returns a blank line.
In the REPL, trying `say :_:` returns `_ => True`.
What is the meaning of this?
admin@mbp ~ % raku
Welcome to Rakudo™ v2023.05.
Impleme
> On 30/06/2023 06:06, ToddAndMargo via perl6-users wrote:
>> if @*ARGS.elems > 0 && "@*ARGS[0]".lc eq "debug" {...}
On 6/30/23 02:40, Richard Hainsworth wrote:
I tried this and it worked without any problem.
And today is is working for me as
my $answer = $choice_1 or $choice_2; # this is wrong it turns into
(my $answer = $choice_1) # or $choice_2
> there $choice_2 is only evaluated if the $answer got assigned a false
value, and then it gets evaluated in void context, discarding its value.
> Try this in Raku - what does it s
to @Helen Block
the low precedence and/or is was introduced in Perl 5 for this construction
open my $fh '<', $input_filename or die "Could not open $input_filename:
$!";
At $work I see bugs where people are using "or" "and" in expressions, and
the part after
I always took [1]
As alternatives to "&&" and "||" when used for control flow, Perl provides
the "and" and "or" operators (see below). The short-circuit behavior is
identical. The precedence of "and" and "or" is m
And then nobody mentions that `and` has low priority. Try `say 42 & 13` and
`say 42 and 13`.
Best regards,
Vadim Belman
> On Jun 30, 2023, at 9:45 AM, yary wrote:
>
> Most of Richard's parting suggestions I understand & agree with, but not
> this: " why a
Most of Richard's parting suggestions I understand & agree with, but not
this: " why are you using '&&' and not 'and' "
My habit (from Perl 5 days) is to use && || for expressions, and reserve
"and" "or" for "
I tried this and it worked without any problem.
Here's the whole program:
use v6.d;
say @*ARGS.raku;
if @*ARGS.elems > 0 && "@*ARGS[0]".lc eq "debug" {
say 'got' }
and at the terminal:
$ raku todd-test.raku debug --debug=50
["debug"
Hi All,
This gets the finger wagged at me for a "Nil"
when @*ARGS.elems equals zero:
if @*ARGS.elems > 0 && "@*ARGS[0]".lc eq "debug" {...}
I have to do this instead:
if @*ARGS.elems > 0 {
if "@*ARGS[0]".lc eq "debug"
Hi All,
I wrote myself a nice example of how to use `qqx`
and `m:` (match). It is pretty simple, so it
is probably "way under" the heads of most of you.
But it is a nice example for beginners:
Notes:
resplendence.com is the home of "Who Crashed":
a great utili
On 11/30/22 12:53, ToddAndMargo via perl6-users wrote:
Let me ask this question a little simpler:
To answer my own questions, which I figured out
the hard way.
1) how to I tell NativeCall I only want the
C pointer back, not what it points to?
By declaring it as a pointer and creating it
Let me ask this question a little simpler:
1) how to I tell NativeCall I only want the
C pointer back, not what it points to?
2) how do I tell NativeCall I am sending it
a C pointer?
Many thanks,
-T
t;)
returns DWORD
{ * };
NativeCall is resolving the pointers automatically
for me. It is taking $pServerName, which is a
Long Pointer to String (LPSTR) and creating the
pointer for me. This is appreciated.
It also returns and resolves the value of “HANDLE”
which is a C Pointer DWORD..
Questi
bject of type NQPMu
>
>
> REPL does not like the $j.
This works for me when I add a couple of 'my's for $j and $k. So it
seems a bug to me. Environment details follow signature.
My usual plaint with the REPL is just that it is a REPL and so cannot
always behave like the compi
On 9/1/22 23:50, ToddAndMargo via perl6-users wrote:
On 9/1/22 19:37, ToddAndMargo via perl6-users wrote:
Hi All,
Is there a cleaner way to do this?
$ raku -e 'print( (sprintf "%.4s", "andefghi" ) ~ "\n";)'
ande
I want to print the first four letter s to STDOUT.
-T
$ raku -e 'p
On 9/1/22 19:37, ToddAndMargo via perl6-users wrote:
Hi All,
Is there a cleaner way to do this?
$ raku -e 'print( (sprintf "%.4s", "andefghi" ) ~ "\n";)'
ande
I want to print the first four letter s to STDOUT.
-T
$ raku -e 'printf "%.4s\n", "andefghi";'
ande
Thank you all!
-T
Hi Todd,
~$ raku -e '(sprintf "%.4s", "andefghi" ).put;'
ande
~$ raku -e 'put (sprintf "%.4s", "andefghi" );'
ande
If sprintf isn't a requirement, then:
~$ raku -e 'put substr("andefghi", 0..3);'
ande
HTH, Bill.
On Thu, Sep 1, 2022 at 7:37 PM ToddAndMargo via perl6-users <
perl6-us...@perl.or
ToddAndMargo via perl6-users @ 2022-09-01 19:37 -07:
> Is there a cleaner way to do this?
>
> $ raku -e 'print( (sprintf "%.4s", "andefghi" ) ~ "\n";)'
> ande
>
> I want to print the first four letter s to STDOUT.
You can use substr,
| put "andefghi".substr(0, 4)
ande
signature.as
the first four letter s to STDOUT.
>
$ raku -e 'printf "%.4s\n","andefghi"'
ande
--
Norman Gaywood, Computer Systems Officer
School of Science and Technology
University of New England
Armidale NSW 2351, Australia
ngayw...@une.edu.au http://turing.une.edu.au/~ngay
Hi All,
Is there a cleaner way to do this?
$ raku -e 'print( (sprintf "%.4s", "andefghi" ) ~ "\n";)'
ande
I want to print the first four letter s to STDOUT.
-T
Will larry wall himself respond: help. I read parts of Programming Perl.
Respect for artificial languages and the mathematicians that implement. I need
friends that are smart, understand computer engineering and the dangers of
playing Dungeons' and Dragons.
I am intelligent and defi
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 prefix:<`>(|c
> 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* >;
>
> insead
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'
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
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>
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: Virt
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: https://archive.virtualmin.com/node
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: https://archive.virtualmin.com/node
(Str)
2) as a fixed length buffer (Buf)
I can think of ways to do this, but it would
require separate variable and conversions routines
back and forth.
Any words of Raku wisdom?
Many thanks,
-T
Hi All,
I do believe what I am asking is not possible in
Raku. In Modula2, it is ridiculously
of ways to do this, but it would
require separate variable and conversions routines
back and forth.
Any words of Raku wisdom?
Many thanks,
-T
Hi All,
I do believe what I am asking is not possible in
Raku. In Modula2, it is ridiculously easy to
do. But there is a fly in the ointment. There
variable that can be
manipulated in two ways:
1) as a fixed length string (Str)
2) as a fixed length buffer (Buf)
I can think of ways to do this, but it would
require separate variable and conversions routines
back and forth.
Any words of Raku wisdom?
Many thanks,
-T
On 6/10/22 01:23, Elizabeth
how can I do this with Raku?
>>>
>>> I wish to create a single variable that can be
>>> manipulated in two ways:
>>>
>>> 1) as a fixed length string (Str)
>>>
>>> 2) as a fixed length buffer (Buf)
>>>
>>>
can think of ways to do this, but it would
require separate variable and conversions routines
back and forth.
Any words of Raku wisdom?
Many thanks,
-T
On 6/10/22 01:23, Elizabeth Mattijsen wrote:
Perhaps https://raku.land/zef:raku-community-modules/Pythonic::Str is what
you're after?
wish to create a single variable that can be
> manipulated in two ways:
>
> 1) as a fixed length string (Str)
>
> 2) as a fixed length buffer (Buf)
>
> I can think of ways to do this, but it would
> require separate variable and conversions routines
> back and f
variable and conversions routines
back and forth.
Any words of Raku wisdom?
Many thanks,
-T
--
~~
Computers are like air conditioners.
They malfunction when you open windows
~~
; > Às 05:27 de 07/04/22, yary escreveu:
> >> For what it's worth, I'm on a mac, promise_test.raku hangs for me once
> in a while also.
> >> Welcome to Rakudo(tm) v2021.04.
> >> Implementing the Raku(tm) programming language v6.d.
> >> Built on Moar
t; Implementing the Raku(tm) programming language v6.d.
>> Built on MoarVM version 2021.04.
>> Trying to reduce it, I would like to find a program that reliably tickles
>> this bug and hangs every time... this variation does not crash for me (I ran
>> it 100
) v2021.04.
Implementing the Raku(tm) programming language v6.d.
Built on MoarVM version 2021.04.
Trying to reduce it, I would like to find a program that reliably
tickles this bug and hangs every time... this variation does not crash
for me (I ran it 100x)
### close_much.raku ###
my Channel $ch .
For what it's worth, I'm on a mac, promise_test.raku hangs for me once in a
while also.
Welcome to Rakudo(tm) v2021.04.
Implementing the Raku(tm) programming language v6.d.
Built on MoarVM version 2021.04.
Trying to reduce it, I would like to find a program that reliably tickles
th
022 at 11:06 AM David Emanuel da Costa Santiago
> > mailto:deman...@gmail.com>> wrote:
> >
> > Hi,
> >
> >
> >
> > I'm trying to learn about promises, supplies and channels. So i made
> > this code:
> >
> >
I'm trying to learn about promises, supplies and channels. So i made
this code:
"""
my $p1 = Supply.interval(5);
my $p2 = Supply.interval(2);
my Channel $ch = Channel.new;
my $prom = start react {
whenever $p1 -> $interval {
No problems so far.
say $*VM; #add as last line, returns:
moar (2021.06)
On Tue, Apr 5, 2022 at 11:06 AM David Emanuel da Costa Santiago <
deman...@gmail.com> wrote:
> Hi,
>
>
>
> I'm trying to learn about promises, supplies and channels. So i made
>
Hi,
I'm trying to learn about promises, supplies and channels. So i made
this code:
"""
my $p1 = Supply.interval(5);
my $p2 = Supply.interval(2);
my Channel $ch = Channel.new;
my $prom = start react {
whenever $p1 -> $interval {
say "5";
Please find the 2022.02 Rakudo Star Windows MSI and Linux RSTAR packages at
https://github.com/rakudo/star/releases/latest
As always, it would be great if someone makes them also available on
https://rakudo.org/star
Thanks & regards
AntonOks
Please find the 2022.02 Rakudo Star Windows MSI and Linux RSTAR packages at
https://github.com/rakudo/star/releases/latest
As always, it would be great if someone makes them also available on
https://rakudo.org/star
Thanks & regards
AntonOks
On 2/10/22 02:25, Elizabeth Mattijsen wrote:
Have you considered giving back to the community by putting this into a module
(as well as the WinMessageBox and WinMount modules that it refers to, which I
assume to be your private modules) and uploading it to the ecosystem?
I have considered
; MessageBox( $IAm ~ ": " ~ $SubName, "Unable to locate Icedrive label",
> MB_ICONERROR, MB_OK );
> }
>
> return $IceDrive;
> }
>
>
> Thank you for the help!
This seems like functionality that could well live in the ecosystem.
Have you cons
to be ignorant about the underlying
OS.
Having a system32 DLL call built in, would be very Windows specific, would it
not?
Yes it would. And it would sure beat the heck out of having to code
NativeCall when you need specific information about
something in the OS.
A lot of Linux specific
esAndTypes
Perhaps what you are looking for. And something you should have been able to
find with a little more work than just writing an email.
Liz
On 2/9/22 12:18, ToddAndMargo via perl6-users wrote:
On 9 Feb 2022, at 12:37, ToddAndMargo via perl6-users
wrote:
Hi All,
Windows 7,10,11
Do we have a command/function that will show all drive
letter and their labels?
Many thanks,
-T
On 2/9/22 04:05, Elizabeth Mattijsen wrote:
> W
On 9 Feb 2022, at 12:37, ToddAndMargo via perl6-users
wrote:
Hi All,
Windows 7,10,11
Do we have a command/function that will show all drive
letter and their labels?
Many thanks,
-T
On 2/9/22 04:05, Elizabeth Mattijsen wrote:
> What would you use on a command-line to get t
What would you use on a command-line to get that information?
Then look at https://docs.raku.org/routine/run
Liz
> On 9 Feb 2022, at 12:37, ToddAndMargo via perl6-users
> wrote:
>
> Hi All,
>
> Windows 7,10,11
>
> Do we have a command/function that will show all
Hi All,
Windows 7,10,11
Do we have a command/function that will show all drive
letter and their labels?
Many thanks,
-T
--
~~
Computers are like air conditioners.
They malfunction when you open windows
~~
Thanks for the geeks on the lists who pointed out a lot of problems to
me.
I want to add the description why I want to make this benchmark. And I
tried to use mmap() for reading file but I have got no benefits from it.
https://blog.cloudcache.net/why-mmap-has-no-significant-effect-in-my-code
beneficial. There are cases where one is more beneficial
over the other.
. and unfortunately it's not really well defined when to use one over
the other.
The general consensus has been that if you plan on jumping around a lot in
a file, then mmap will be superior to read.
Otherwise wh
Thanks Paul. I am surprised that mmap has that huge IO advantages
comparing to the classic way. So ruby take more benefit from this mmap
calling. Just get learned from your case.
Regards
On 15.01.2022 17:57, Paul Procacci wrote:
Hey John,
One more follow up and then it's bedtime f
Sorry, it's 5:00am here and needless to say it's wy past my bedtime and
I'm making mistakes.
The comparison should have been between both ruby versions ugh.
I'll let you play though. Have a great night.
On Sat, Jan 15, 2022 at 4:57 AM Paul Procacci wrote:
>
Hey John,
One more follow up and then it's bedtime for me. I wanted to further this
discussion just a little bit more by implementing the mmap solution that I
applied to perl to ruby instead. Now all of a sudden, ruby is much much
faster. My ruby source code follows:
Goodnight!
# rub
Hey John,
On Sat, Jan 15, 2022 at 3:04 AM Jon Smart wrote:
>
> Hello Paul
>
> Do you mean by undef $/ and with <$fh> we can read the file into memory
> at one time?
>
In most cases the short answer is yes.
I have problems with your wording however given the 'g
Hello Paul
Do you mean by undef $/ and with <$fh> we can read the file into memory
at one time?
Yes that would be faster b/c we don't need to read file by each line,
which increases the disk IO.
Another questions:
1. what's the "truss" command?
2. what's
Hey Jon,
The most glaringly obvious thing I could recommend is that at least in your
perl routine (and probably the other languages) most of your time is
context switching reading from the disk.
Now, my perl version is indeed faster, but one has to ask themselves, was
.015193256 seconds really
Hello,
May I show the result of my benchmark for perl5, ruby, and scala?
https://blog.cloudcache.net/benchmark-for-scala-ruby-and-perl/
Welcome you to give any suggestion to me for improving this.
Thanks.
Great! Thanks.
El sáb, 25 dic 2021 a las 12:18, escribió:
> Hi all.
>
> The Rakudo-Star 2021.12 Windows MSI and Linux RSTAR packages are
> available at [1]. The previous Windows MSI build under [2] is also
> updated to 2021.10... just in case someone was using this repo and
Hi all.
The Rakudo-Star 2021.12 Windows MSI and Linux RSTAR packages are
available at [1]. The previous Windows MSI build under [2] is also
updated to 2021.10... just in case someone was using this repo and it's
versions somewhere. @Coke | @jnthn | @lizmat | @moritz | @rba |
@sena_kun |
ily have a sliding window over an array, where the window
might hang over either end of the array.
> my @a =
[a b c d e]
> say @a[^3 + $_]:v for -2 .. 4
(a)
(a b)
(a b c)
(b c d)
(c d e)
(d e)
(e)
But anyway, my original use case was driven by a desire to simplify a
routine similar to the fol
even though it looks like
> it should just evaluate to True.
In Raku `foo[-N]` is invalid. At compile-time if N is statically
known, otherwise at run-time.
You must be used to PLs that treat a negative index as an offset
from the end. Designers of older PLs considered this a feature.
A
On Fri, Dec 10, 2021 at 1:48 PM I wrote:
> So this looks pretty buggy, but I wonder if I'm somehow invoking undefined
> behavior by combining semicolons and adverbs while subscripting. The
> online docs cover both features separately, but not in tandem that I can
> see.
>
A
be
a shorter way to express it. Then I remembered nested arrays can be
accessed by separating the indices with semicolons, so I tried:
return () if @array[$y;$x]:!exists or ...
A whole bunch of errors ensued when I ran the program. I experimented some
more on the console and saw some pretty
hello people,
> I am still defending that we need a package for data
> analysis/science/engineer (like the Perl5 PDL, Python Pandas or R
> data.table) and an IDE for streaming programming like jupyter or rstudio.
I'm still excited about this idea and my offer to test/feedback/do
Maybe my favorite example of the differential applications of `comb` vs
`split`. Below, sometimes you want to precisely tease-apart text, and
`comb` works towards that end. Other times you want to destructively
blast-away at text--eliminating the destractions--so you use `split`, until
you see the
On 11/1/21 19:07, Patrick R. Michaud wrote:
If you want only the first 10 digits, then:
How about if I want 64 or more digits?
This is a place where .comb() is likely much better than .split() -- .comb()
allows you to specify what you're wanting instead of what you're wanting to
avoid:
$ raku -e "say sqrt(2).comb(/\d/).join(', ');"
1, 4, 1, 4, 2, 1, 3, 5, 6, 2, 3, 7, 3, 0, 9, 5, 1
If you want only the first 10 di
You did great for not knowing Raku!
~$ raku -e "say sqrt(2).split(/\.|''/);"
( 1 4 1 4 2 1 3 5 6 2 3 7 3 0 9 5 1 )
~$ raku -e "say sqrt(2).split(/\.|''/).raku;"
("", "1", "", "4", "1", "4", "2", "1", "3", "5", "6", "2", "3", "7", "3",
"0", "9", "5", "1", "").Seq
~$ raku -e "say sqrt(2).split(/\.|
On Mon, Nov 1, 2021 at 1:53 AM sisyphus wrote:
> Note that what you have there is a 200-decimal-digit (around 658-bit)
> precision representation of the square root of 2 - which is quite different
> to the (53-bit precision) Real sqrt(2).
>
Always gotta be careful with reals. I also attempted
On Mon, Nov 1, 2021 at 2:35 PM ToddAndMargo via perl6-users <
perl6-us...@perl.org> wrote:
> On 10/31/21 19:39, Sean McAfee wrote:
>
> > (2.FatRat, { $_ / 2 + 1 / $_ } ... (* - *).abs < 1e-100).tail
>
> 1.414213562373095048801688724209698078569671875376948073176679737990732478462107038850387534
function which acts on 64-bit floating point numbers, and
there's no more meaningful digits available. If you need more precision
you're on your own.
Dang! I was hoping ther was some thing like UInt.
Fortunately, it's easy.
Wikipedia describes the following recurre
On Sun, Oct 31, 2021 at 6:51 PM ToddAndMargo via perl6-users <
perl6-us...@perl.org> wrote:
> >> How do I get more digits out of sqrt?
>
> On 10/31/21 17:50, Kevin Pye wrote:
> > You don't.
> >
> > sqrt is a function which acts on 64-bit floating poi
How do I get more digits out of sqrt?
On 10/31/21 17:50, Kevin Pye wrote:
> You don't.
>
> sqrt is a function which acts on 64-bit floating point numbers, and
there's no more meaningful digits available. If you need more precision
you're on your own.
Dang! I
You don't.
sqrt is a function which acts on 64-bit floating point numbers, and there's no
more meaningful digits available. If you need more precision you're on your own.
On Mon, 1 Nov 2021, at 11:20, ToddAndMargo via perl6-users wrote:
> On 10/31/21 16:42, ToddAndMargo via
On 10/31/21 16:42, ToddAndMargo via perl6-users wrote:
On 10/31/21 11:20, Sean McAfee wrote:
On Sun, Oct 31, 2021 at 9:08 AM Andinus via perl6-users
mailto:perl6-us...@perl.org>> wrote:
put 2.sqrt.comb.grep(*.Int)>>.Int[^10].raku # 10 digits
comb takes an argument that can save you
On 10/31/21 11:20, Sean McAfee wrote:
On Sun, Oct 31, 2021 at 9:08 AM Andinus via perl6-users
mailto:perl6-us...@perl.org>> wrote:
put 2.sqrt.comb.grep(*.Int)>>.Int[^10].raku # 10 digits
comb takes an argument that can save you a method call:
2.sqrt.comb.grep(*.Int)
==>
On Sun, Oct 31, 2021 at 9:08 AM Andinus via perl6-users <
perl6-us...@perl.org> wrote:
> put 2.sqrt.comb.grep(*.Int)>>.Int[^10].raku # 10 digits
>
comb takes an argument that can save you a method call:
2.sqrt.comb.grep(*.Int)
==>
2.sqrt.comb(/\d/)
ToddAndMargo via perl6-users @ 2021-10-30 23:57 -07:
> Without going into why (it is a secret), how do I turn
>
>> my $x = sqrt 2
> 1.4142135623730951
>
> into an array of integers?
> @y[0] = 1
> @y[1] = 4
> @y[2] = 1
> @y[3] = 4
> @y[4] = 2
> @y[5] = 1
put 2.sqrt.comb.grep(*.Int)>>.Int[^10]
ecimal-point?
sqrt(333) = 18.24828759089466...
If you say:
my $wanted_digits = 5;
, which of these are you wanting:
1824828
18248
?
]
Like most languages, the "precision" (number of digits actually gen
On Sun, Oct 31, 2021 at 10:10 PM ToddAndMargo via perl6-users <
perl6-us...@perl.org> wrote:
> On 10/31/21 01:43, Shlomi Fish wrote:
>
> >
> >> ("" ~ sqrt(2)).comb().grep(* ne ".").map(+*)
> > (1 4 1 4 2 1 3 5 6 2 3 7 3 0 9 5 1)
>
> Cool!
>
> my Int @x = ("" ~ sqrt(2)).comb().grep(* ne ".").map(+*
On 10/31/21 01:43, Shlomi Fish wrote:
("" ~ sqrt(2)).comb().grep(* ne ".").map(+*)
(1 4 1 4 2 1 3 5 6 2 3 7 3 0 9 5 1)
Cool!
my Int @x = ("" ~ sqrt(2)).comb().grep(* ne ".").map(+*)
[1 4 1 4 2 1 3 5 6 2 3 7 3 0 9 5 1]
Is there a way to set how many digits I get?
secret), how do I turn
> >
> > > my $x = sqrt 2
> > 1.4142135623730951
> >
> > into an array of integers?
> > @y[0] = 1
> > @y[1] = 4
> > @y[2] = 1
> > @y[3] = 4
> > @y[4] = 2
> > @y[5] = 1
> >
> > etc.
> >
> >
> > Many thanks,
> > -T
> >
> >
> >
--
Shlomi Fish https://www.shlomifish.org/
https://www.shlomifish.org/open-source/projects/fortune-mod/
Summer Glau gave Richard III a horse free-of-charge and let him keep his
kingdom for himself.
— https://www.shlomifish.org/humour/bits/facts/Summer-Glau/
Please reply to list if it's a mailing list post - https://shlom.in/reply .
Hello
Try this one:
use strict;
use Data::Dumper;
my $x = sqrt 2;
my @li= grep{/\d+/} split//,$x;
print Dumper \@li;
$ perl t1.pl
$VAR1 = [
'1',
'4',
'1',
'4',
'2',
'1',
'3',
'5',
'6',
Hi All,
Without going into why (it is a secret), how do I turn
> my $x = sqrt 2
1.4142135623730951
into an array of integers?
@y[0] = 1
@y[1] = 4
@y[2] = 1
@y[3] = 4
@y[4] = 2
@y[5] = 1
etc.
Many thanks,
-T
Thanks for the packages. Nice to see this release.
On Sat, Oct 30, 2021 at 2:41 AM wrote:
> Hi all.
>
> The Rakudo-Star 2021.10 Windows MSI and Linux RSTAR packages are available at
> [1].
> The previous Windows MSI build under [2] is also updated to 2021.10... just
> i
Hi all.
The Rakudo-Star 2021.10 Windows MSI and Linux RSTAR packages are available at [1].
The previous Windows MSI build under [2] is also updated to 2021.10... just in case someone was using this repo and it's versions somewhere.
@Patrick, feel free to copy packages from [1] or [2]
> 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 wrot
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
1 - 100 of 12397 matches
Mail list logo