🦋 Welcome to the MAIN() IRC channel of the Raku Programming Language (raku.org). Log available at irclogs.raku.org/raku/live.html . If you're a beginner, you can also check out the #raku-beginner channel!
Set by lizmat on 6 September 2022.
Anton Antonov @tonyo Worked with a simple fez. Just now: raku.land/zef:antononcube/WWW::MermaidInk 01:37
Xliff m: sub a { my $a = 0; $a ?? 42 }; 08:21
camelia ===SORRY!=== Error while compiling <tmp>
Unexpected closing bracket
at <tmp>:1
------> sub a { my $a = 0; $a ?? 42 ⏏};
Xliff ^^ This looks to be LTA - Error should be...
m: 0 ?? 1
camelia ===SORRY!=== Error while compiling <tmp>
Confused: Found ?? but no !!
at <tmp>:1
------> 30 ?? 1⏏<EOL>
Xliff ^^ lizmat MasterDuke [Coke] 08:22
Xliff .tell lizmat Question for you -- I have utility that I am writing and it would be great if I could use String::Utils::root if String::Utils is detected. I've tried this - 'require ::("String::Utils"); ::("&root").^name.say;' with no luck. What would you suggest? Thanks! 08:44
tellable6 Xliff, I'll pass your message to lizmat
lizmat .tell Xliff why not rip out the code of sub root from String::Utils ? 08:59
tellable6 lizmat, I'll pass your message to Xliff
lizmat it's only 30 lines: you might need to stick a "use nqp" in it though :-)
tellable6 hey lizmat, you have a message: gist.github.com/df683fe5a6f3088517...ec70573a6a 09:00
tbrowder__ .seen jubilatious 09:55
tellable6 tbrowder__, I haven't seen jubilatious around
tbrowder__ .seen jubilatious1 10:30
tellable6 tbrowder__, I haven't seen jubilatious1 around
lizmat clickbaits rakudoweekly.blog/2023/04/17/2023-...udent-win/ 10:31
Geth ecosystem: Demayl++ created pull request #617:
Add Terminal::Size to the ecosystem
11:05
ecosystem/main: 624be4377c | Demayl++ | META.list
Add Terminal::Size to the ecosystem
11:08
ecosystem/main: aa272a5e67 | (Juan Julián Merelo Guervós)++ (committed using GitHub Web editor) | META.list
Merge pull request #617 from Demayl/master

Add Terminal::Size to the ecosystem
guifa Xliff: are you using the FQN? 12:22
tellable6 guifa, I'll pass your message to Xliff
lucs Xliff: What do you mean by ⌊$a ?? 42⌉? 12:41
tellable6 lucs, I'll pass your message to Xliff
lizmat lucs: it was about the error message *that* produced 12:44
lucs Oh, I see, thanks.
rf Morning folks 14:03
Anton Antonov @rf Hi! As far as I know, you did not make a Raku last weekend. Again. 14:10
guifa Is there any way for slang writing to namespace? NQPMatch and Match aren't compatible 14:12
rf Yeah you are right Anton, soon haha 14:17
vrurg guifa: what do you mean? 14:40
guifa vrurg: I'll try to get a MWE / golfed version tonight, off to $day-job now 14:57
[Coke] m: my @a=<5 34 2 4>; dd @a.map(+*).sort({$^a <= $^b}) 15:22
camelia (34, 5, 4, 2).Seq
[Coke] Can someone explain why it's order high to low there? I would have expected low to high 15:24
Nemokosch I think it's because sort takes a comparator which a mere <= isn't. A comparator should produce More, Less or Same 15:44
m: my @a=<5 34 2 4>.map(+*); say @a[0] <= @a[1]; say Order(@a[0] <= @a[1]); 15:46
Raku eval True Exit code: 1 No value 'True' found in enum Order in block <unit> at main.raku line 1
Nemokosch aalmoost
m: my @a=<5 34 2 4>.map(+*); say @a[0] <= @a[1]; say (@a[0] <= @a[1]).Order;
Raku eval True More
lizmat m: my @a=<5 34 2 4>; dd @a.map(+*).sort({$^a <=> $^b}) 16:00
camelia (2, 4, 5, 34).Seq
lizmat m: my @a=<5 34 2 4>; dd @a.map(+*).sort({$^b <=> $^a})
camelia (34, 5, 4, 2).Seq
tonyo guifa: you are definitely an edge case haha, taking a look at that issue today 16:04
[Coke] Thank you. will give a better example in the docs. 16:07
(for sort)
[Coke] ... or I'll just read the docs more. 17:01
p6steve m: <5 34 2 4>.sort.reverse.say 17:04
Raku eval (34 5 4 2)
p6steve another way ;-)
no need to coerce to Num with '+' since sort (cmp) "compares numbers with number semantics" 17:06
Nemokosch keep in mind that the elements here are a bit of a corner case: they are allomorphs 17:16
I think their numeric nature will have precedence but it's a bit tricky because something else might deduce them to be strings 17:17
[Coke] p6steve, I did need the sort comparator function, I just was starting with the simplest one. 17:40
moritz m: say "aa" ~~ /$<start>=<.alpha> $<start>/ 17:58
camelia 「aa」
start => 「a」
moritz m: say "aa" ~~ /$<start>=<alpha> $<start>/
camelia Nil
moritz bug or unknown-to-me feature?
moritz I've opened github.com/rakudo/rakudo/issues/5248 for that, assuming it's a bug 18:07
[Coke] gist.github.com/coke/a018706e1abb7...6610adfd16 - weird fetch FAIL when trying to install cro locally 19:23
it's not that dep, specifically, getting that on everything I try to install. 19:26
ah, might be a local cert issue (works fine in the browser) 19:29
ugexe you could test that theory by seeing if `zef install 360.zef.pm/C/RO/CRO/b2222c623bcc77...58.tar.gz` fails but `zef install 360.zef.pm/C/RO/CRO/b2222c623bcc778...58.tar.gz` installs 19:32
oh maybe not
i thought there was non-https urls as well
ah there is, there was just a trailing ` in the clickable link of my irc client 19:33
so yeah you should be able to run those two commands and see if one works and one doesnt
[Coke] "something went wrong extracting .... Win32::Registry 19:34
zef used to work fine on this windows box, wonder what happened. :|
[Coke] updates git bash on the hope it also updates curl and default certs. 19:42
ugexe i'm not sure if zef will use that curl or not 19:43
modern windows comes with a version of curl now 19:44
ok to answer that question zef will try to use `curl.exe --help` first, and if that fails it will try `curl --help`. it picks how it invokes its curl that way 19:45
the fun part is on modern windows with the git bash stuff installed a person will have 3 curls. 1) a curl.exe included in modern versions of windows 2) a curl.exe included with the git bash tools 3) a curl command that is just a powershell around a simple fetcher but doesn't emulate the curl cli api at all 19:49
[Coke] installing an updated git bash I must have picked a weird option because it "lost" my installed raku and 'raku -version' isn't using utf8 20:06
and now that I resolved the path, the curl is still failing. Wondering if it was a dayjob windows update that updated local certs unhelpfully 20:07
Xliff \o 21:38
tellable6 2023-04-18T08:59:10Z #raku <lizmat> Xliff why not rip out the code of sub root from String::Utils ?
2023-04-18T12:22:34Z #raku <guifa> Xliff: are you using the FQN?
2023-04-18T12:41:40Z #raku <lucs> Xliff: What do you mean by ⌊$a ?? 42⌉?
Xliff guifa: I was using the FQN, yes. It still didn't work. Reason: That routine is in a "my" scope and exported via EXPORT() 21:40
And I don't think I can get access to EXPORT
m: sub a { }; &a.^methods.map( *.name ).grep( *.starts-with("s") ).say 21:46
camelia (soft set_op_props set_why signature static_id)
p6steve I think that (1,4,3).sort will work ....beginner level "some integers can be sorted", expert level "these literals are InStr Allomorphs that will auto numify so that cmp goes to <=> and then that coerces its arguments to Int" 21:47
m: (1,4,3).sort.say
Raku eval (1 3 4)
Xliff Do Sub objects expose the type of scope they've been declared as? 21:48
m: my sub a { }; our sub b { };
camelia ( no output )
Xliff ^ Is there a method that I can use that can tell me the scope of a() and b()? 21:49
[ 'our' vs 'my' ]
.tell lizmat A simple and obvious soluition. Thanks! 21:54
tellable6 Xliff, I'll pass your message to lizmat
Nemokosch what I meant is 21:58
m: dd (1, 4, 3); dd <1 4 3> 21:59
Raku eval (1, 4, 3) (IntStr.new(1, "1"), IntStr.new(4, "4"), IntStr.new(3, "3"))