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
6
votes
3 answers

No such method for invocant of type

I've created a class which contains multi definitions for function overloading, however when I try to call the class and the overloaded method, it throws an error. A working example which can be run to produce this error is shown below: class…
madcrazydrumma
  • 1,847
  • 3
  • 20
  • 38
6
votes
1 answer

Module name matching

I have a list of module names, as Strs, extracted from the META6.json. Specifically, the depends array. This contains the following entries: "Config::Parser::toml:ver<1.0.1+>", "Config:api<1>:ver<1.3.5+>", …
Tyil
  • 1,797
  • 9
  • 14
6
votes
1 answer

Callwith not calling other candidates? What are "other candidates"? Is it exhausting the list of other candidates? Is that list available?

I'm trying to address this issue, which was actually raised by this other stackoverflow question related to the different behavior of callwith and samewith. The latter seems to be clearly defined, however, it's not so clear with callwith. Check out…
jjmerelo
  • 22,578
  • 8
  • 40
  • 86
6
votes
1 answer

Where should "Cro Endpoint HTTP" be defined?

The console shows this this message after starting cro ('cro run'): ▶ Starting JoanPujol (JoanPujol) **Endpoint HTTP will be at http://localhost:20000/** JoanPujol Listening at http://localhost:3000 JoanPujol Shutting down... ♻ Restarting…
Mimosinnet
  • 743
  • 3
  • 8
6
votes
2 answers

Perl6 Making an observable timer

I am trying to write an observer pattern using a timer class which invoke its subscribers at a given interval. All while trying to understand the concept of promises in Perl6. class Timer does Observable { has Promise $!p; has Int…
Mikkel
  • 575
  • 2
  • 6
6
votes
2 answers

Colons in variables

Colons can be used as part of a variable name in Perl 6, together with angle brackets. These are apparently called extended identifiers, and are used to define things such as infix:<+>. my $foo:bar = 3; my $foo:bar<2> = 2; my $foo:bar =…
jjmerelo
  • 22,578
  • 8
  • 40
  • 86
6
votes
1 answer

How to tune Vim Perl 6 syntax highlighting to de-emphasize sigils?

I'm using vim-perl6 for syntax highlighting, but I'd like to adjust the color of variable sigils so that they are less standout. Perhaps, make them look pale or something. How do I do that? Thanks.
cowbaymoo
  • 1,202
  • 5
  • 14
6
votes
1 answer

How to convert an url to an IP address

Right now I'm learning the Perl 6 language, and I'd like to know how to convert an url to an IP address It seems to me that the gethostbyname function does not exist.
7hsk
  • 335
  • 2
  • 10
6
votes
1 answer

perl6 "An operation first awaited"

This program creates a thread to read a directory with dir() and place the files on a channel. $N worker threads read that channel and "process" (prints) the files. However I'm getting this "An operation first awaited:" error. I've read the traps…
Norman Gaywood
  • 357
  • 2
  • 7
6
votes
3 answers

perl6: Array; get rid of empty slot (Any)

For an Array containing only Str elements, I can use grep(Str) in order to eliminate empty slot following a :delete; For example: my @prov_cd = ; @prov_cd[2]:delete; # Manitoba…
pcarrier
  • 141
  • 2
6
votes
3 answers

What's the meta-object rule for naming grammar rules

As indicated in this issue, some token names clash with method names in the class hierarchy of Grammar (which includes Match, Capture, Cool, Any and obviously My.). For instance, `Mu.item grammar g { token TOP { }; token item {…
jjmerelo
  • 22,578
  • 8
  • 40
  • 86
6
votes
1 answer

Turn off perl-debug-m ansi escape sequences on Windows 7

On Windows 7 cmd.exe, the perl6-debug-m script outputs ansi escape sequences to set the colors, I suppose. How do I suppress these codes or at least make them functional? I'm just getting started with Perl 6 after working with Perl 4 and Perl 5…
Dan Hale
  • 91
  • 2
6
votes
2 answers

Subsetting Blocks (or Callables in general)

This question was originally posted by lookatme in the Perl6 IRC channel. The original intention is to constrain a Callable by using subsets or any other possible way. It works in signatures, however this: subset WalkCb of Callable where *.signature…
jjmerelo
  • 22,578
  • 8
  • 40
  • 86
6
votes
1 answer

Problems with Dateish strings

This code (for checking the changed timestamp of the current directory): my $date = ".".IO.changed.DateTime.yyyy-mm-dd but Dateish; say $date; yields the error: «Ambiguous call to 'gist(Str+{Dateish}: )'; these signatures all match:␤: (Str:D:…
jjmerelo
  • 22,578
  • 8
  • 40
  • 86
6
votes
3 answers

index() error message incorrect for third parameter?

sub count-a { my $word = "banana"; my $count = 0; my $foo; # Source of error: $foo intentionally not given a value. # The value ought to be zero. while True { $foo = index $word, "a", $foo; last…
Clint
  • 109
  • 2