🦋 Welcome to Raku! raku.org/ | evalbot usage: 'p6: say 3;' or /msg camelia p6: ... | irclog: colabti.org/irclogger/irclogger_log/raku
Set by ChanServ on 14 October 2019.
Xliff m: my @a = do $_ * 2 for ^6; @a.say; 00:19
camelia [0 2 4 6 8 10]
rypervenche m: my @a = do $_ * 2 for 0..^6; @a.say; 00:23
camelia [0 2 4 6 8 10]
rypervenche :)
japhb m: my @a = ^6 .map: * * 2; @a.say 00:55
camelia [0 2 4 6 8 10]
japhb I mean, if you're going to play around, best to go farther afield, right?
m: my@a=^6 .map: * * 2;@a.say # Whitespace golf 00:57
camelia [0 2 4 6 8 10]
japhb m: (my@a=^6 »*»2).say # OK, now I'm just being silly 01:01
camelia [0 2 4 6 8 10]
rypervenche How do you represent a null character in Raku? \0 ? I'm trying to find it on the site. 01:55
elcaro m: say "\0".uniname 02:02
camelia <control-0000>
elcaro i'm not sure it's documented explicity anywhere. see this issue: github.com/Raku/doc/issues/2313 02:03
Xanozoid hi 02:04
rypervenche elcaro: Thank you. 02:05
Xliff m: my $f = sub { $^a * 2 }; my @a = ^5 » $f(*); @a.say 02:07
camelia 5===SORRY!5=== Error while compiling <tmp>
Missing infix inside hyper
at <tmp>:1
------> 3my $f = sub { $^a * 2 }; my @a = ^5 »7⏏5 $f(*); @a.say
expecting any of:
infix
infix stopper
Xliff m: my $f = sub { $^a * 2 }; my @a = (^5).map: $f(*); @a.say
camelia Cannot resolve caller Numeric(Whatever:D: ); none of these signatures match:
(Mu:U \v: *%_)
in sub at <tmp> line 1
in block <unit> at <tmp> line 1
Xliff m: my $f = sub { $^a * 2 }; my @a = (^5).map({ $f($_) }); @a.say
camelia [0 2 4 6 8]
Xanozoid can Raku be ran client-side in a website? 02:08
Xliff Actually, it can with rakudo-js
Xanozoid is that the official name for it? or is that a supported target via Rakudo? I can't really seem to find much on the web about that 02:09
Thanks Xliff
Xliff blogs.perl.org/users/pawel_murias/2...arcel.html 02:10
Xanozoid I'm getting a feeling it's not really completely supported . . . dead link and very small example - and the most recent update is 2018? 02:12
Xliff github.com/rakudo/rakudo/tree/master/src/vm/js 02:13
It's still around. See above 02:14
pilne anyone know off the top of their head how to use this under win32? my ($h, $w) = qx/stty size/.words>>.Int; I have tried a quick google, but nothing i'm finding is very direct. 02:16
i know the problem lies in the qx/stty size/ part
Xanozoid Xliff looking at it right now - good to see that it exists! 02:17
Xliff m: .say for 0, 2 .. 10 03:37
camelia 0
2..10
Xliff m: .say for 0, 2 ... 10
camelia 0
2
4
6
8
10
Xliff m: .say for ^10.rotor(2)
camelia Potential difficulties:
Precedence of ^ is looser than method call; please parenthesize
at <tmp>:1
------> 3.say for ^107⏏5.rotor(2)
Xliff m: .say for (^10).rotor(2)
camelia (0 1)
(2 3)
(4 5)
(6 7)
(8 9)
Xliff m: "φ".uniname.say 03:51
camelia GREEK SMALL LETTER PHI
pilne is there a cheat sheet somewhere that has the non-unicode version of the popular/all unicode commands? 03:52
holyghost I revived Game-Markov in github.com/theholyghost2/p6-Game-Markov 05:41
I will be implementing more Markov strategies in that package e.g. Markov Chain Monte Carlo methods, samplers 05:42
Xliff m: $a; ($a = $_ for 1...5).map({ $_ / 2 }).gist.say 06:39
camelia 5===SORRY!5=== Error while compiling <tmp>
Variable '$a' is not declared
at <tmp>:1
------> 3<BOL>7⏏5$a; ($a = $_ for 1...5).map({ $_ / 2 }).
Xliff m: my $a; ($a = $_ for 1...5).map({ $_ / 2 }).gist.say
camelia (2.5 2.5 2.5 2.5 2.5)
Xliff m: my %a; (%a{$_} = $_ for 1...5).map({ $_ / 2 }).gist.say
camelia (0.5 1 1.5 2 2.5)
holyghost I've put in a Metropolis-Hastings algorithm in p6-Game-Markov on github 06:46
It's the most known Markov algorithm 06:47
nine pmurias: do you remember anything at all about how one can use Perl's pluggable keyword mechanism to detect the end of a Perl 5 block in the surrounding Raku code? I did have the same idea once but can't for the life of mine remeber how to pull that off. 13:31
tellable6 nine, I'll pass your message to pmurias
lucs Can I have raku and zef run using other directories than ~/.raku and ~/.zef? 14:54
(Want to play with different versions of raku and make absolutely sure that there are no interferences with whatever raku is already installed on my system) 14:55
regreg is anyone here familiar with moarvm? 14:56
where can i read more about moarvm?
i want to know what kind of ISA it uses
lucs (I think I know how to fix the PATH for this, but not ~/.raku and ~/.zef)
regreg and what are it's limitations
leont There is a #moarvm channel 14:59
regreg thanks 14:59
chloekek I recall somebody was interested in packaging Rakudo and Raku packages for Nix, but I don’t recall their name. 15:04
Thing is, for doing that I was working on this index of packages called CRAI and I’m not sure if I want to continue running it. 15:06
Right now it is not all that useful; it indexes all archives from CPAN and p6c every hour and displays metadata about them on a website. This includes the URL and the hash, which are very useful for package managers. 15:07
Considering I’m not using Raku all that much I’d like to not run that server anymore as I currently pay for hosting it every month and I don’t think anyone is using it, but the software may still have potential. 15:08
regreg chloekek, how much does it costs to run the server? and what about time sunk? 15:09
chloekek Oh lol it’s only 6 EUR apparently. 15:10
rba chloekek: what is this used for exactly?
regreg i could pay for it if it has any use for the community but i don't know how to manage it 15:11
chloekek rba: There are currently two places where you can find Raku library archives: CPAN and the ecosystem repository. CPAN provides an easy way to download specific versions (archives) of libraries, but the ecosystem does not as it just points to Git repositories’ master branch.
rba If there is common community usage, I might take it over under the umbrella of raku infra.
regreg but it will have to wait until i receive next disability payment (which will about around 12 march)
chloekek rba: So I wrote a cronjob that periodically downloads all those libraries though stable tarball URLs, and computes their hashes. This information could be useful if exposed in a machine readable format, but I don’t really have the time to work on that. 15:12
It generates a SQLite database that has a table in it with (tarball URL, tarball hash, META6 extract)
rba Does it overlap with modules.raku.org or zef?
chloekek modules.raku.org only seems to index latest version of each library, and does not provide hashes. 15:13
Without hashes, you don’t really know what you are downloading.
The problem is really with ecosystem repository, it just points to Git repositories, but those don’t tell you how to get a specific version of each library.
rba Got it. I will take over hosting. Who is taking over the development?
chloekek Say you want Foo::Bar v1.0. You would need to clone its git repository and search the git commits for the one that bumps the version to v1.0 in META6.json, except for the rare case of libraries using Git tags. 15:14
And even then, the author could release v1.0, then update the repository to include malicious code, and change the tag to refer to the new commit, and people would suddenly be deploying that. 15:15
rba May we look into details later today. 20:00 CET or later, or this sunday? 15:17
chloekek Sure.
May open an issue on problem-solving about archiving and version discovery. 15:18
jmerelo: was also interested in this.
tellable6 chloekek, I'll pass your message to jmerelo
chloekek Here’s an example of what it indexes: crai.foldr.nl/archive?url=https://...e8c.tar.gz 15:21
rba Chloekek: problem-solving makes sense.
chloekek I suppose integrating the cronjob into modules.raku.org would make sense, but we’ll discuss this on/after the problem-solving issue. :) 15:24
Xliff m: sub a { say $*ROUTINE.name }; a; 17:34
camelia Dynamic variable $*ROUTINE not found
in sub a at <tmp> line 1
in block <unit> at <tmp> line 1
Xliff m: sub a { say $?ROUTINE.name }; a;
camelia 5===SORRY!5=== Error while compiling <tmp>
Variable '$?ROUTINE' is not declared. Did you mean 'Routine'?
at <tmp>:1
------> 3sub a { say 7⏏5$?ROUTINE.name }; a;
Xliff m: sub a { say &?ROUTINE.name }; a; 17:35
camelia a
Xliff m: sub a ('one', 'two', 'three') { say &?ROUTINE.signature.params.map( *.type ).join(', ').say-route }; a('one', 'two', 'three'); 17:38
camelia Use of uninitialized value of type Str in string context.
Methods .^name, .raku, .gist, or .say can be used to stringify it to something meaningful.
in sub a at <tmp> line 1
Use of uninitialized value of type Str in string context.
Methods .…
Xliff m: sub a ('one', 'two', 'three') { say &?ROUTINE.signature.params.map( *.name ).join(', ').say-route }; a('one', 'two', 'three');
camelia Use of Nil in string context
in sub a at <tmp> line 1
Use of Nil in string context
in sub a at <tmp> line 1
Use of Nil in string context
in sub a at <tmp> line 1
No such method 'say-route' for invocant of type 'Str'
in sub a at <…
Xliff m: sub a ('one', 'two', 'three') { say &?ROUTINE.signature.params.map( *.name ).join(', ').say }; a('one', 'two', 'three');
camelia Use of Nil in string context
, ,
True
in sub a at <tmp> line 1
Use of Nil in string context
in sub a at <tmp> line 1
Use of Nil in string context
in sub a at <tmp> line 1
Xliff The hell... these are constants. How can I get their value from the signature? 17:43
Xliff Any Cro ppl here? 19:27
cpan-raku New module released to CPAN! Date::Calendar::FrenchRevolutionary (0.0.4) by 03JFORGET 19:37
Jose86 Quick question when using zef to install a module, in this case Cro, it didnt get added to the Path variable. Does zef currently not do this? 21:40
rypervenche Jose86: Not that I've seen. I set my PATH for my zef-installed modules to be usable (for the executables) 21:41
Jose86 Thank you rypervenche
cpan-raku New module released to CPAN! Gnome::N (0.15.7) by 03MARTIMM 21:51
Geth doc: 89fd872197 | (Tom Browder)++ (committed using GitHub Web editor) | doc/Language/quoting.pod6
correct typo
21:52
linkable6 Link: docs.raku.org/language/quoting
san_goku_ssj_10 Hi. Is Rakudo free of malwares ? 22:50
san_goku_ssj_10 HELP 23:17
How could I change the the value of an argument passed to a routine ? 23:18
The variable is immuable, and i don't know how to override this feature 23:19
SORRY, I'M A BIG NOOB
san_goku_ssj_10 Altai-man_ Hi 23:23
Altai-man_ san_goku_ssj_10, o/
oh
san_goku_ssj_10, can you provide some code? a couple of lines showing what do you want to do. 23:24
as for argument passed, you can e.g. set it as `is rw`:
m: sub foo($a is rw) { $a = 42 }; my $b = 50; say $b; foo($b); say $b;
camelia 50
42
Altai-man_ san_goku_ssj_10, is ^ close to what you want? 23:25
lizmat there's also "is copy"
sleep&
Altai-man_ lizmat, good night, rest well. o/ 23:26
san_goku_ssj_10 lizmat help 23:41
please
rypervenche Du calme, there's no rush here :) 23:42
san_goku_ssj_10 please 23:43
pastebin.com/raw/Gg0bMDix
this code does not work
please help me
I'm a super noob
and new to Raku
I don't understand
please help !
rypervenche san_goku_ssj_10: I believe you should make the default value in the signature. 23:44
san_goku_ssj_10 rypervenche could you please post a sample ? 23:45
rypervenche san_goku_ssj_10: pastebin.com/raw/9yBNackX 23:45
That is one way, if you want the default $message to have a certain value. 23:46
san_goku_ssj_10 rypervenche thanks. It's impossible to change the value of the variable inside the routine ? 23:48
rypervenche san_goku_ssj_10: As others have said, you can add "is rw" or "is copy" after Str $message in the signature. 23:49
san_goku_ssj_10 I have try it 23:50
but I have this error message
Parameter '$message' expected a writable container, but got Str value in sub message at main.pl line 3 in block <unit> at main.pl line 10
rypervenche Ah yes, I'm wrong there. 23:51
Try "is copy" instead. 23:52
That works.
san_goku_ssj_10 thanks
Perl6 is a lot functionnal 23:53
i think
rypervenche That's the idea :)
san_goku_ssj_10 thanks 23:55