🦋 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.
[Coke] I like the idea of a themed advent instead of 25 separate articles 00:04
tbrowder__ yes! 00:13
(maybe, if broad enough) 00:14
tbrowder__ what them ya thinkin of, LLM? also, we're running out of time... 00:28
to herd cats
antononcube Well, I am definitely doing LLM if succeed making an Advent article. 00:34
Geth ¦ raku.org: coke assigned to dontlaugh Issue add -dev site like for docs github.com/Raku/raku.org/issues/218 00:36
SmokeMachine m: gist.github.com/FCO/076855906b0af9...cddea9a52c 02:20
camelia ( no output )
Geth ecosystem: dankogai++ created pull request #627:
rename branch from master to main
03:12
arkiuat I've been trying to figure out how to set up the same kind of behavior as the perl5 empty diamond operator (reading from files on command-line, if any, or STDIN if not). Learned a lot about sub MAIN and command-line arg processing, but not yet what I set out for. 06:11
oh, sorry, that's probably more appropriate for #raku-beginner 06:16
Geth ecosystem/main: aa73b4a6e7 | (Dan Kogai)++ | META.list
rename branch from master to main
06:35
ecosystem/main: c4bb0a1c61 | (Juan Julián Merelo Guervós)++ (committed using GitHub Web editor) | META.list
Merge pull request #627 from dankogai/main

rename branch from master to main
ab5tract_ SmokeMachine: I’ve neglected to mention that I liked your presentation. Interesting stuff! I’m very curious about what you will come up with next :) 07:27
arkiuat: it’s a fine question for here as well. Can you share what you’ve come up with so far? 07:28
SmokeMachine ab5tract_: thank you very much. :) 07:33
SmokeMachine arkiuat: maybe you are searching for something like this? 08:04
m: sub MAIN($file = "-") { .say for $file.IO.lines }
camelia »Wann treffen wir drei wieder zusamm?«
»Um die siebente Stund‘, am Brückendamm.«
»Am Mittelpfeiler.«
»Ich lösche die Flamm.«
»Ich mit«

»Ich komme vom Norden her.«
»Und ich vom Süden.…
nemokosch 🤣 08:43
arkiuat SmokeMachine, thank you. That works beautifully. I'd forgotten about the special - filename. 08:56
SmokeMachine :)
arkiuat ab5tract_ I'd been messing around with something like sub MAIN (:$f) { given $f { when Str { .say $f.IO.lines }; when Bool { .say $*IN.IO.lines if $f } } } thinking that a -f flag without a filename ought to make it read standard input 09:00
patrickb Hi! Is there some convention which filename and format to use for a raku module changelog file? 09:08
A quick search revealed: metacpan.org/dist/CPAN-Changes/vie...s/Spec.pod and keepachangelog.com/ 09:09
They are sadly .... not the same thing.
lizmat patrickb: as I use App::Mi6, I follow whatever that uses :-) 09:14
tellable6 2023-11-09T21:10:38Z #raku-dev <vrurg> lizmat The only method is nqp::findmethod(HLL::Compiler, 'PERFOR-CHECL').(self). See command_eval in src/Perl6/Compiler.nqp.
arkiuat ab5tract_ left out the "for"s while typing. Should've pasted it 09:17
and it turns out that version even works when a filename is provided, once I finished correcting the last of my syntax errors. But the second when clause still doesn't work (because I don't yet understand how raku refers to STDIN internally yet, I guess), and using the - filename is much nicer anyway 09:21
patrickb lizmat: The App::Mi6 changelog looks like CPAN::Changes::Spec. I guess that's what I should go with now. Sooner or later we as a community should make a recommendation and doc it. 09:23
gfldex lolibloggedalittle: gfldex.wordpress.com/2023/11/10/mi...tuousness/ 12:44
tellable6 2023-10-29T02:15:00Z #raku <Xliff> gfldex That usually stems from when you try to serialize an object that isn't a @, % or Cool-based $
2023-10-29T02:15:46Z #raku <Xliff> gfldex You'll get that if you do something like: "unit package A; class B { has $.c }; our $c; BEGIN $c = B.new"
2023-10-29T02:16:38Z #raku <Xliff> gfldex That also extends to the contents of any @ or % value you are trying to cache at BEGIN time.
gfldex SmokeMachine: please note ^^^
codesections I'm having trouble detecting a Mu value in NQP. nqp::isnull and nqp::isnull_s both return 0, but dump throws an error saying it's a VMNull. What am I missing here? 14:56
I'm trying to fix github.com/Raku/nqp/blob/b0bbc4d57...#L612-L619 14:57
which is currently calls tryfindmethod on Mu (i.e., unset) action objects 14:58
codesections oops, ^^^ was intended for #raku-dev (though feel free to answer if you know :D ) 15:11
tonyo are you just looking for nqp::what($a) ? 15:16
codesections Maybe? I tried that, but still couldn't find a way to use it to detect a Mu 15:17
tonyo you're looking for the equiv of if Mu ~~ $a ?
codesections nqp::isnull(nqp::what($a)) still returns 0 for Mu 15:18
tonyo m: use nqp; my Mu $a; say nqp::who($a) eq 'Mu' 15:19
camelia True
codesections Yeah; something that returns True (or 1, I guess in NQP) for Mu 15:20
Oh, I thought that'd be too hacky :D
But maybe that's just how nqp rolls?
tonyo wonder what ~~ does for type checks under the hood 15:21
i'd figured it'd be nqp::who($something) eq nqp::who(Mu) 15:22
ugexe github.com/rakudo/rakudo/blob/a9da...od#L37-L44
checking for a string Mu is done in at least one other spot it looks like 15:23
lib/NativeCall.rakumod: if $r.returns.^name ne 'Mu' && !validnctype($r.returns) { # another one 15:24
although that one is from a module, not from core 15:25
tonyo github.com/Raku/nqp/blob/b0bbc4d57...lass.t#L29 15:27
looks like it might just be .isa
codesections but everything isa Mu, right? 15:28
tonyo only eventually 15:29
m: use nqp; my Mu $a = Nil; my Int $b; say nqp::callmethod(Mu, "isa", $a); say nqp::callmethod(Mu, "isa", $b)
camelia True
False
tonyo depends on what order you ask
a pebble is a rock but a rock is not necessarily a pebble
ugexe m: my int $a; say $a.^name; # why does ^name turn e.g. int to Int? 15:30
camelia Int
codesections I think because int doesn't have a HOW, so $a.HOW($a, name) auto-upgrades to an Int 15:32
ugexe m: my uint $a; my UInt $b; say $a.^name; say $b.^name 15:33
camelia Int
UInt
tonyo oh yea, there was a bug with uint coercing from a long time ago 15:47
codesections Hmm, neither of the ideas above seem to work either :( 15:55
nqp::callmethod(Mu, "isa", $a) returns 0 15:56
and nqp::who($actions) eq nqp::who(Mu) throws Cannot stringify object of type BOOTHash
codesections nqp::who($actions) eq 'Mu' works, though 16:14
I _guess_ I'll go with that, even though I feel slightly dirty having a hardcoded string there 16:15
codesections Oh, wait, I shouldn't have been using nqp::callmethod with "isa" – I should've used nqp::istype(Mu, $a) 17:18
I think that might work
[Coke] int isn't an object, so if you do object stuff to it, it has to upgrade it. 18:37
thebb www.youtube.com/watch?v=XZ3w_jec1v8 21:07
[Coke] context, before we click on it? 21:12
thebb "The Economics of Programming Languages", talks about programming environments and how money flows impact them (corporate vs open source) 21:19
librasteve m: say dd <6_1/2> 21:54
evalable6 RatStr.new(30.5, "6_1/2")
Nil
Raku eval Nil RatStr.new(30.5, "6_1/2")