🦋 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.
irced so uh yeah raku 07:55
tyil yes 08:05
irced any new compilers in the makings? 08:06
tyil not from me, but it's certainly possible someone else is making one 08:08
irced how come the java virtual machine became the most focused on? 08:10
moon-child ? as fas as I can tell, moarvm has seen the most attention 08:10
irced oh, back to the raku history books 08:11
irced what's the difference? 08:11
vegetable-lover hey, is there any way to package a raku program for distribution (besides docker)? I'd like to make something my teammates could use 08:12
moon-child irced: moarvm was written for raku, and maps well to its semantics. Jvm and js are also targets, but they're largely fringe; jvm is incredibly slow, the only reason to use it is interop with java libs
and afaik the js target is somewhat immature
irced moon-child: i see. 08:13
tyil vegetable-lover: this might be relevant for you wakelift.de/can-you-appimageine-that/ 08:15
vegetable-lover tyil: thanks for the link! looks like a fair bit of work though 08:16
tyil I'm sure a lot is automatable, which would be a nice project for someone I'm sure :> 08:17
vegetable-lover possibly maybe! 08:20
MasterDuke irced: the jvm was focused on early because it was more mature than moarvm, especially in the concurrency support. aiui, jnthn used the jvm to prove out the plan for raku's concurrency, and once he was satisfied that the higher-level plan/design was good, pretty much switched over to moarvm completely and it became the primary target 09:13
but the jvm backend can still be faster for some long running programs (and the not-yet-completed truffle backend can be even faster still) 09:14
irced takes notes. 09:16
thanks
MasterDuke np 09:18
PimDaniel \o 13:09
In Perl5 it was possible to capture groups directly into variable like this : my ($x,$y1,$y2)) = $ind =~ /^(\d+):(\d+)_(\d+)$/; for example. How can we do it in Raku? 13:11
i tried my ($x ,$y1,$y2) = $ind ~~ /^ (\d+):(\d+)_(\d+) $/; without success. 13:12
PimDaniel The subject is : "regexes". 13:13
lizmat I would do it like this: 13:14
m: my ($a,$b) = "foo".match(/ (.) (.) /)>>.Str; say $a; say $b
camelia f
o
lizmat the >>.Str is just a trick to: 1. force .list on the Match object, and 2. stringify on the fly (otherwise you'd get Match objects in $a and $b 13:15
PimDaniel lizmat: And where are my : and _ chars controls gone? 13:19
lizmat you mean m:i/ foo bar/ ? 13:20
PimDaniel No. 13:21
lizmat then please clarify :-)
tusooa PimDaniel: you can just put them in quotes 13:23
PimDaniel lizmat: my ($x ,$y1,$y2) = $ind ~~ /^ (d+):(d+)_(d+) $/; : what i'm trying to capture is inserted into a string.
lizmat aaah... ok
what tusooa said: quote them
PimDaniel lizmat did you well observ my regexp? 13:24
lizmat *anything* non-alphanumeric must be quoted in Raku regexes
PimDaniel lizmat ok
lizmat PimDaniel: sorry, was focussing on the assignment part :-)
tusooa (\d+)":"
lizmat and for readability, add spacing
lizmat /^ (\d+) ':' (\d+) '_' (\d+) $/ 13:25
PimDaniel lizmat hum okay. i'v forgotted to quote 13:26
PimDaniel thank's tusooa
PimDaniel thank's lizmat. 13:27
tusooa np
PimDaniel what is that error: Directive d not applicable for value of type Match (「77:22_46」 13:29
should work!
lizmat could it be that you're trying on a command line, and shell quoting is messing you up ? 13:30
PimDaniel lizmat : no i run my program. 13:31
I think it's just a simple mistake.
lucs PimDaniel: Time to paste the code somewhere for us to view :) 13:32
lizmat $ r 'say "77:22_46" ~~ /^ (\d+) ":" (\d+) "_" (\d+) $/'
「77:22_46」
0 => 「77」
1 => 「22」
2 => 「46」
PimDaniel i use to use pastebin but is there a way to paste linked to this topic or with an irc command? 13:34
pastebin.com/HhhNJXxP 13:35
PimDaniel lizmat not the same code as mine. 13:36
I got 3 left values in my original code.
Mmmm well no sure it is the problem anyway. 13:37
lizmat the problem is in the printf
it gets a Match object, and printf is not smart enough to convert that for you 13:38
which could be considered a bug, I'd need to think about that
lizmat my ($x ,$y1,$y2) = ($ind ~~ /^ (\d+) ':' (\d+) '_' (\d+) $/)>>.Int # note the >>.Int to get ints into the variable 13:39
PimDaniel lizmat i knew that using printf, i could face type object, but the error message is really stupid and tells me noting. 13:41
lizmat "Directive d not applicable for value of type Match (「77:22_46」" seems pretty descriptive to me? 13:42
lizmat if the error points to the printf 13:42
lucs PimDaniel: There was probably a line number for that error message, pointing to the printf, no?
MasterDuke nope 13:45
m: printf("%d sdf\n", Mu.new)
camelia Directive d not applicable for value of type Mu (Mu.new)
in block <unit> at <tmp> line 1
lucs :(
Oh, wait, line 1
PimDaniel Okay, i admit! 13:46
lucs PimDaniel: If you keep using Raku, you'll eventually become impressed at the general high quality of the error messages. 13:47
MasterDuke i think you only get the pointers to the place for compile time errors (which hopefully a lot of printf errors might become after rakuast lands)
lucs Making so many mistakes, I know I am!
PimDaniel But now why don't $x.Int work? 13:47
MasterDuke i wonder if it'd be better to say 'Directive %d ...'? 13:48
PimDaniel printf("x: %d,y1: %d,y2: %d\n",$x.Int,$y1.Int,$y2.Int) should work, no?
MasterDuke or 'Directive "%d" ...'
lucs MasterDuke: That looks like an improvement, indeed.
MA 13:49
(More Awesome)
lizmat MasterDuke lucs I'm about to commit that :-) 13:50
lucs lizmat++ Thanks :)
PimDaniel I don't mind to use say or print instead of printf. 13:51
lucs PimDaniel: Depends on the circumstances I suppose. 13:52
lucs doesn't suppose, he knows ;)
Part of the answer to many questions: "It depends." 13:53
lizmat otoh, I think printf should just take Match objects, as they're Cool 13:54
lizmat makes mental note to check the RakuAST implementation for that
PimDaniel Hum i think it'll works with printf if declare my variable types at first into my first my and then use lizmat >>.Int
lucs PimDaniel: The 「printf(…, $x.Int, …)」 fails if you did only 「… ~~ /^ … $/ …」 (without the 「>>.Int」), because in that case, it's $x that receives the whole match ($y1 and $y2 get nothing). 14:02
PimDaniel lucs : no, because because i had not the parenthesis. 14:03
lucs PimDaniel: Uh, so you fixed it, okay :)
lucs finds it really hard to debug code that is described, not read.
PimDaniel but then i received a list of matches instead of a list of Ints
[Coke] github.com/Raku/doc/blob/master/do...6#L87-L141 - are the names in this table literal strings that have to appear as is? (I assume column two the answer is yes, but what about the last column, e.g. "guillemotleft") 15:22
(trying to cleanup failing doc spelling test) 15:25
rir_ A question on error messages: Can the colorization be shut off? Neovim is less than vim in regards to the tty environment it gives when you ":!raku % | less". 15:27
[Coke] docs.raku.org/programs/03-environm...ROR__COLOR 15:28
rir_ Thank you, Coke. 15:30
[Coke] FYI, I had no idea, I just searched the doc site.
rir_ Yes. I do that a lot, with fair success. Sometimes I seem to just think too differently. 15:35
Geth doc: 2375bd4699 | Coke++ | xt/pws/code.pws
track new words from compose table
15:36
[Coke] rir_: I searched for "color", fwiw. 15:37
anyway, glad it was already there and documented. :)
lizmat rir_: you might also find this interesting: docs.raku.org/programs/03-environm...S__HANDLER 16:16
lizmat and another Rakudo Weekly News hits the Net: rakudoweekly.blog/2021/03/08/2021-...ated-star/ 17:04
El_Che let me check if I am already famous 17:07
lizmat alas... no mention of El_Che in this week's RWN 17:08
El_Che still a nobody
lizmat sorry, I'm not Oprah :-) 17:09
El_Che lizmat: you're the Oprah of Raku 17:10
lizmat eek
El_Che "you get a speedup, you get a speedup, speedups for everbody!" 17:11
lizmat but that's only so because we both have to watch our weight :-)
leont Another weekly, yet I still haven't published that module :-o 17:52
moritz lizmat++ # weekly 17:55
lizmat leont: there'll be another Weekly :-) 18:15
gfldex .seen raiph 20:25
tellable6 gfldex, I saw raiph 2021-02-22T00:18:21Z in #raku: <raiph> SmokeMachine: goodnight; I hope you dream of throwing dictionaries through hoops :)
Doc_Holliwood m: say <1 2 3>.map: { |( $_ xx 2 ) } 22:25
camelia (1 1 2 2 3 3)
Doc_Holliwood is there a better way to do this? (doubling the list)
Doc_Holliwood Z of course, i am an idiot 22:27
lucs Doc_Holliwood: Can you spell it out for future people who read the chat logs? 22:31
lucs pretends he knows how to do what Doc_Holliwood is talking about. 22:32
Doc_Holliwood m: say flat <1 2 3> Z <1 2 3>
camelia (1 1 2 2 3 3)
lucs Thanks :)
gfldex m: say ((1,2,3) xx 2).&[Z].flat; 22:42
camelia (1 1 2 2 3 3)
gfldex m: say ((1,2,3) xx 8).&[Z].flat;
camelia (1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3)
gfldex Doc_Holliwood: you can have as many as you want ^^^ 22:43
gfldex .oO( I ♥ .& ) 22:44
Doc_Holliwood i know about xx. i didnt like the parens
just looks nicer this way =) twitter.com/HrBollermann/status/13...2690476038 22:45
what i didn't know is that you can do a &[] 22:47
gfldex Doc_Holliwood: That is not overly surprising because that's an ENODOC. It is very well specced tho. 23:14
m: say &[Z].name;
camelia infix:<Z>
Doc_Holliwood enodoc? 23:20
gfldex error not documented 23:25
gfldex that you can find it in /usr/include/errno.h is also an error :-> 23:26
moon-child enodoc is itself an enodoc o_O 23:29
gfldex .oO( Raku is a very functional PL. Even our errors are recursive. ) 23:39
tbrowder hi, folks, i need a sanity check on raku number handling 23:58
watch
m: say -1.5e0.Int 23:59
camelia -1
tbrowder but
m: say -1.5e0.abs
camelia -1.5
tbrowder a wee bug it looks to me