Questions tagged [raku]

For questions relating to the Raku programming language (formerly known as Perl 6).

Raku

Raku is an expressive and feature-rich programming language designed by Larry Wall and developed by the community.

Features include:

  • Object-oriented programming
  • Functional programming primitives
  • Parallelism
  • Concurrency
  • Asynchrony
  • Definable grammars for pattern matching and generalized string processing
  • Optional and gradual typing
  • Extensive Unicode support from code points to grapheme clusters
  • Multiple dispatch
  • Introspection
  • Rational numbers

is a Raku implementation that targets multiple back ends.

The MoarVM back end is recommended for normal use, but back ends for the Java Virtual Machine and JavaScript are also under active development.

The Rakudo implementation shipped a first official release named “коледа” on December 25, 2015. Most of the specification is frozen, and optimizations are ongoing.

Official links

1993 questions
5
votes
1 answer

Slip documentation bug ??? [ RAKU ]

In raku documentation for class Slip (https://docs.raku.org/type/Slip) and also in "Lists, sequences, and arrays" documentation (slips section: https://docs.raku.org/language/list), it is stated that "slip", "Slip (method)" and "| (prefix)" can be…
jakar
  • 1,701
  • 5
  • 14
5
votes
1 answer

How to modify matrix in raku-lang

When I try to modify matrix in raku. I got the error : my @matrix = ^100 .rotor(10); @matrix[1;*] = 1 xx 10 Cannot modify an immutable Int (10) in block at line 1 @matrix[1;1] = 3 Cannot modify an immutable List ((10 11…
黃家億
  • 355
  • 1
  • 4
5
votes
2 answers

Raku/Perl6: how do you code a NULL with NativeCall

https://docs.perl6.org/language/nativecall "As you may have predicted by now, a NULL pointer is represented by the type object of the struct type." https://learn.microsoft.com/en-us/windows/win32/api/winreg/nf-winreg-regqueryvalueexw C++ …
Todd
  • 976
  • 4
  • 10
5
votes
1 answer

From Raku/Perl6, how to read this registry key?

Windows With Raku/Perl6, how do I use NativeCall to read the value of [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\ "EnableLUA"] with…
Todd
  • 976
  • 4
  • 10
5
votes
0 answers

Cro run throwing connection reset by peer

I am trying to implement the Cro Service from the Cro getting started documentation. It compiled fine but when I tried to access the link using browser, it shows cannot reach the site and throws "Connection reset by peer" error with no other…
Abeer
  • 153
  • 6
5
votes
1 answer

How to initialize a fixed array to a value with Raku

It may be silly but I haven't found a good solution in the documentation about how to initialize a fixed array, or multidimensional array on an easy way without iterating. my @array[10] = [0,0,0,0,0,0,0,0,0,0]; my @grid[100;100];
Javi
  • 305
  • 2
  • 7
5
votes
2 answers

Question on the array generating sequence in Raku

I've come across this code at rosettacode my @pascal = [1], { [0, |$_ Z+ |$_, 0] } ... Inf; .say for @pascal[^4]; # ==> # [1] # [1 1] # [1 2 1] # [1 3 3 1] Inside the explicit generator block, I know how the individual operators like the list…
Lars Malmsteen
  • 738
  • 4
  • 23
5
votes
1 answer

Create and populate an array of Raku objects?

I chose to redesign a portion of the previous code of mine, in this case, a chessboard, in Perl 6. The first two classes went well (or at least worked, I know so little that I can't speak to their correctness), but I'm stuck with the third. Here is…
hsmyers
  • 665
  • 7
  • 10
5
votes
1 answer

How to insert variable in user-defined character class?

What I am trying to do is to allow programs to define character class depending on text encountered. However, <[]> takes characters literally, and the following yields an error: my $all1Line = slurp "htmlFile"; my @a = ($all1Line ~~ m:g/ (\" || \')…
lisprogtor
  • 5,677
  • 11
  • 17
5
votes
1 answer

how to escape quotes in shell function?

This is Rakudo Star version 2019.03.1 built on MoarVM version 2019.03 implementing Perl 6.d. Windows 10 Examples: 1) Error: shell 'mysqldump -uroot -ppassword asppmr > D:\b\29-09-2019 19-45-18\asppmr.sql'; mysqldump: [Warning] Using a password on…
Shniperson
  • 549
  • 4
  • 9
5
votes
1 answer

Log::Timeline Visualisation in IntelliJ

Is the Log::Timeline Visualization also supported with the Comma IDEA Plugin for IntelliJ or is it only part of the standalone Comma IDE? And if it is supported with IntelliJ, are there additional components needed in IntelliJ?
LuVa
  • 2,288
  • 2
  • 10
  • 20
5
votes
0 answers

How to get the version of a module

I'm trying to implement the --version option of my module, but I do not know how to access META6.json file. Any idea how to this? I could copy to resources dir but that's LTA.
Antonio Gamiz Delgado
  • 1,871
  • 1
  • 12
  • 33
5
votes
1 answer

trans function hang forever when work with a single `^` or `$`

When trans method work with regex such as /^/, it hangs and can't return any more! for (-9, -6 ... 0, 2 , 4 ... 10).rotor( 2 => -1) { .join(',').trans(/^/ => '[', /$/ => ')' ).say; } I expetcet it to print out the…
chenyf
  • 5,048
  • 1
  • 12
  • 35
5
votes
1 answer

Type capture for positional arguments

Type captures are a cool thing to use for even some simple stuff: sub assert-same(::T $a, T $b) { ; } assert-same 1, 2; # silent assert-same 1, "a"; # type check error However, the result is non-intuitive for positionals. If I have the…
user0721090601
  • 5,276
  • 24
  • 41