🦋 Welcome to the MAIN() IRC channel of the Raku Programming Language (raku.org). This channel is logged for the purpose of keeping a history about its development | evalbot usage: 'm: say 3;' or /msg camelia m: ... | Log inspection is getting closer to beta. If you're a beginner, you can also check out the #raku-beginner channel!
Set by lizmat on 25 August 2021.
Xliff \o 12:52
Altreus vrurg: saw your post on reddit :) glad something grew out of that 12:54
apparently it's an ADHD trait to only realise some time later that you weren't saying what you actually intended to say 12:55
vrurg Altreus: I wouldn't say I was intended to say that. :) But really, it was a productive discussion and not only on that aspect. 13:38
Altreus vrurg: I mean I failed to realise what I was trying to say :D 13:39
vrurg Ah, ok... :D 13:40
tbrowder g'day all 13:59
i'm getting a when using mi6 that reports Tap is using deprecated code 14:00
but zef says the module isn't installed! 14:01
any idea what i should do, if anything? thnx 14:02
*a msg when...
lizmat perhaps zef is using one internally ? 14:03
tbrowder hm 14:04
tbrowder i think you're right, thnx, lizmat, nick has been very busy lately :-) 14:06
tbrowder modules.raku shows Tap but zef can't find it... 15:05
ok, it must be parent of Tap::Harness, Raku.land shows that 15:07
bye
ugexe its TAP not Tap 15:08
patrickb tonyo: I'm wondering about raku.land/cpan:SEGOMOS/fez Is SEGOMOS your CPAN handle? 15:19
tbrowder yes, TAP 16:00
Slaytanical I'm going to be giving all the documentation i can find a good read tonight, but I'm going to attempt to setup "rakudo on a (usb) stick" where everything related to it (including zef stuff) stays on the usb stick. Any pointers? or has someone done this in the past and can point me to the instructions? Ty in advance (: 16:02
melezhik how can I do http redirect in cro , after processing post request? 16:39
tellable6 2021-09-15T15:12:34Z #raku-dev <lizmat> melezhik you might find this interesting: raku.land/zef:lizmat/Rakudo::Options
melezhik lizmat++ 16:40
this is not good - github.com/melezhik/topsdevops/blo....raku#L121 as it redirect user to "/" with POST method 16:41
but I need to redirect with GET
Altreus I don't think redirect specifies a method at all 17:12
you can use redirect :see-other to give it a 303
oh they went 17:13
I think the answer is to use created, not redirect
tonyo .tell patrickb that is a cpan test account i have, fez is there in reference to: github.com/ugexe/zef/issues/410 17:41
tellable6 tonyo, I'll pass your message to patrickb
grondilu how do I reverse an array? from <a b> how do I get { "a" => 0, "b" => 1 } ? I thought .pairs.invert.hash would work but apparently not 18:03
[Coke] m: my @a=<a b>; dd @a.kv.reverse.Hash 18:05
camelia Hash % = {:a(0), :b(1)}
[Coke] kv is probably faster/cheaper than doing pairs. 18:06
immediate m: say <a b>.antipairs.Hash
camelia {a => 0, b => 1}
[Coke] even better. :)
grondilu nice, never seen .antipairs before
[Coke] if you wanted to manually do the pairs, you'd need to invert the pairs themselves, you're inverted the list of paris.
*you've 18:07
grondilu unrelated: wasn't there a `=finished` directive to comment everything from here to EOF? 18:10
lizmat =finish 18:14
which oddly does not appear to findable on docs.raku.org 18:15
[Coke] not documented on docs.raku.org/language/pod 18:18
github.com/Raku/doc/issues/2284
(That ticket also notes the current state (as of last year) about various pod features. 18:20
grondilu damn I think I will never understand grammars :( 18:56
m: say "000" ~~ /0*<digit>+/ 18:57
camelia 「000」
digit => 「0」
grondilu ^this I understand, but then...
codesections does anyone have access to a Windows install handy? This SO question (stackoverflow.com/questions/691919...ty-in-repl ) makes me think that `$PATH` might not be set properly in Windows
grondilu m: ay grammar { token TOP { <leading-zeros><digit>+ }; token leading-zeros { 0* } }.parse: "000"
camelia 5===SORRY!5=== Error while compiling <tmp>
Undeclared routine:
ay used at line 1
grondilu m: say grammar { token TOP { <leading-zeros><digit>+ }; token leading-zeros { 0* } }.parse: "000" 18:58
camelia Nil
grondilu isn't it supposed to be the same thing?
codesections m: say grammar { regex TOP { <leading-zeros><digit>+ }; regex leading-zeros { 0* } }.parse: "000" 18:59
camelia 「000」
leading-zeros => 「00」
digit => 「0」
grondilu ok, can you explain to me why it doesn't work with tokens? 19:00
oh I see 19:02
"Regex methods are slow but thorough, they will look back in the string and really try."
codesections grondilu: yep! token { 'some pattern' } is like regex { :ratchet 'some pattern' } see docs.raku.org/language/regexes#Nam...ion_syntax
grondilu so tokens don't backtrack. got it.
codesections which means the token version matches "0001" just fine 19:04
grondilu it's really not a token that I'm parsing, now that I think about it.
grondilu hum... wasn't there a way to cut a long sequence of method calls into several lines? I can't make it work anymore. 19:23
do I have to backslash the newlines? 19:24
lizmat you can put whitespace between the invocant and the method nowadays 19:25
m: dd 42 .Str 19:26
camelia "42"
moon-child lizmat: I have had problems with doing that in the (recent) past
lizmat grondilu ^^
grondilu but no newlines apparently
lizmat yes, they can be newlines, afaik
moon-child however you can use ==> instead in some cases
gfldex grondilu: in doubt you can use \ to quote the newline 19:27
grondilu but that is very ugly
it used to work fine and was very nice 19:28
gfldex still work if you do `42␤.say` but not for `42.␤say` 19:30
lizmat grondilu: please provide an example where it doesn't work
then we can submit a bug report :-)
codesections A backslash is also required in *any* "method" in the chain is really a sub being called *as* a method. 19:34
m: sub add1 {$_ + 1}; 5.5.round.&add1.say; # doesn't work with newlines/spaces without \ 19:35
camelia Too many positionals passed; expected 0 arguments but got 1
in sub add1 at <tmp> line 1
in block <unit> at <tmp> line 1
codesections m: sub add1($_) {$_ + 1}; 5.5.round.&add1.say; # doesn't work with newlines/spaces without \
camelia 7
immediate What is the meaning of a twigil-less variable that is declared with `has` in a class? 19:39
e.g., `class A { has $val }`
This answer is where I saw it: stackoverflow.com/a/62969222 19:40
xinming releasable6: status 19:46
releasable6 xinming, Next release in ≈2 days and ≈23 hours. There are no known blockers. Changelog for this release was not started yet
xinming, Details: gist.github.com/fdb6dacf285b68e53f...eb0e958666
grondilu gist.github.com/grondilu/b35ede989...8c84c99a7b 19:52
I could probably trim it more but oh well 19:53
gfldex m: class C { has $a; }; say C.^attributes; 19:54
camelia (Mu $!a)
gfldex immediate: ^^^
codesections gfldex: I noticed that too, but it left me more confused rather than less. Are you saying that `has $a` is an exact synonym for `has $!a`? If so, I've sure been writing a lot of needless !s 19:56
gfldex codesections: I didn't check Roast but the docs don't mention this form, so this might be an artifact. 19:57
moon-child roast has it 19:58
codesections hmm, so it's just missing from the docs?
moon-child S12-attributes/instance.t, S12-class/attributes.t, S03-binding/attributes.t
gfldex looks like it 19:59
And it's likely not the last ENODOC. Raku is BIG! 20:00
grondilu m: say <foo bar>.antipairs.hash<foo>; 20:06
camelia 0
grondilu ^this fails if I put a newline after bar> 20:07
in fact:
m: say <foo bar> .antipairs.hash<foo>;
camelia 5===SORRY!5=== Error while compiling <tmp>
Missing required term after infix
at <tmp>:1
------> 3say <foo bar> .antipairs.hash<foo>7⏏5;
expecting any of:
prefix
term
grondilu just a space is enough 20:08
m: say <foo bar> .elems.perl; 20:09
camelia 2
grondilu m: say (<foo bar> .antipairs.hash)<foo>; 20:10
camelia 0
grondilu hum I guess using a postcircumfix messes things
grondilu vaguely remembers something about this 20:13
Geth doc/attribute-alias: 6fd14c79a5 | (Daniel Sockwell)++ (committed using GitHub Web editor) | doc/Language/objects.pod6
Document attribute aliases

Part of the spec in Roast S12-class/attributes.t
  github.com/Raku/roast/blob/master/....t#L23-L33
20:18
doc: codesections++ created pull request #3963:
Document attribute aliases
codesections grondilu: I agree, that *is* pretty odd 20:26
m: say <foo bar> .antipairs.hash<note> 1;
camelia Noted
False
immediate gfldex: thanks what is ENODOC, cant find in the glossary 20:28
and should one use $val instead of $!val
codesections it's jargon/slang for ERROR: Not Documented
gfldex immediate: ENODOC is a not overly serious reference to www.virtsync.com/c-error-codes-include-errno 20:29
[Coke] ENOTLA 20:35
ENOCOFFEE
ENOBEER #actually timezone appropriate