🦋 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.
lizmat m: say (1,2.2,3e0,4i).are 08:19
camelia (Numeric)
lizmat m: say (1,2.2,3e0,4i,"foo").are
camelia (Cool)
lizmat m: say (1,2.2,3e0,4i,"foo",now).are 08:20
camelia (Cool)
lizmat m: say (1,2.2,3e0,4i,"foo",Date.today).are
camelia (Any)
lizmat wayland: ^^^
tellable6 lizmat, I'll pass your message to wayland
wayland m: my int8 $a = 42; say $a.WHAT 09:09
camelia (Int)
tellable6 2024-07-16T08:20:45Z #raku <lizmat> wayland: ^^^
wayland Anyone know how to print out the native type (int8)?
lizmat: Great! That's definitely going to save me from reimplementing it poorly :D 09:14
lizmat wayland: more recently there's also .are(type) which will return a Bool indicating whether all types match the given type 09:15
wayland Oh, nice!
lizmat re: my int8 $a, there's currently no way to find out other than to dive deep into nqp land 09:16
int8 is not a HLL type itself, so it will upgrade all accesses to Int and that's what you're seeing
wayland Oh, that's a pity. I was going to use it to create eg. fields in Postgres that had the relevant types. But if it's not easily implemented, then I'll stick to more general types for now, and implement that later. 09:17
Hmm. The search for this channel won't do dates after 2024-06-13. 09:20
wayland Oh. But then it ignores the date and searches to today anyway. 09:21
Oh, my bad, I just needed to click refresh. Soz. 09:22
lizmat yeah, one of the buglets that I need to fix one of these days 09:23
wayland Another question: Where do I go to read about the ::T syntax? I had a skim through some of the doco, but didn't see anything that looked useful. 09:33
lizmat good question: I hoped to find something under generics... but alas... 09:39
please make a doc issue for this
wayland: vrurg.github.io/2020/11/16/Report-...-Coercions 09:40
and vrurg.github.io/2020/11/30/Report-...ons-Part-2 09:41
wayland lizmat: docs.raku.org/language/signatures#Type_captures maybe? 09:44
lizmat heh... yes 09:45
internally they're called generics ... been spending too much time on internals this year :-)
wayland m: my ::T = Str; say ::T; 09:46
camelia ===SORRY!=== Error while compiling <tmp>
Malformed my
at <tmp>:1
------> my ::T⏏ = Str; say ::T;
wayland I'm essentially trying to store a type in a variable again. 09:47
lizmat m: sub a(::T $a) { dd $a }; a Str
camelia Str
lizmat but if it's just about storing a type: 09:48
lizmat m: my $a = Str; say $a 09:48
camelia (Str)
wayland Yes, I'm aware that it can be done via a signature, but I want to store it in an attribute of an object. Essentially I have an object that represents a field in a DB. But maybe I should just go with Parameter.new() and put that in the attribute.
Oh, yeah, that's easier :). 09:49
lizmat if you want to make sure that only types can be stored, you could use the Any:U constraint 09:50
m: 'my Any:U $a = Str; say $a
camelia ===SORRY!=== Error while compiling <tmp>
Unable to parse expression in single quotes; couldn't find final "'" (corresponding starter was at line 1)
at <tmp>:1
------> 'my Any:U $a = Str; say $a⏏<EOL>
expecting any of:
lizmat m: my Any:U $a = Str; say $a 09:51
camelia (Str)
lizmat m: my Any:U $a = "foo"; say $a
camelia Type check failed in assignment to $a; expected Any:U but got Str ("foo")
in block <unit> at <tmp> line 1
wayland Oh, nice! Thanks! 09:52
lizmat: Done! github.com/Raku/doc/issues/4499 09:56
lizmat: Should I put in a bug requesting a way to identify native types, or is that covered somewhere already? 09:57
lizmat yeah, that feels like a good idea :-) 09:58
wayland lizmat: Does it go on github.com/rakudo/star ? 10:01
lizmat no, /rakudo/rakudo please
wayland OK, thanks!
lizmat m: my int8 $a; dd $a.VAR.HOW.native_type.^name # getting closer 10:03
camelia "int"
lizmat it *is* somewhere in the bowels :-) 10:04
wayland lizmat: OK, created one for that too: github.com/rakudo/rakudo/issues/5605 :) 10:11
lizmat thanks! 10:11
tbrowder and alias to “native-type”? 13:35
[Coke] TIL about "/layout save" on irssi. nice 17:16
That only took me 20 years. 17:22
jdv took me about that long to learn about the esc-# to select channels 18:30
hitting ctrl-p and ctrl-n via connectbot on android was such a pain 18:31
[Coke] Anyone here have a 3d printer? 18:46
[Coke] makerworld lets you turn a png into a keychain fob, so I made a 4-color camelia (not as nice as the default 6-color, but easy to print on my rig.) 19:24
[Coke] getting a "too many open files" in a raku/doc xt test after adding in calls via HTTP::Tiny. Any suggestions on how to track down what files are being kept open? 20:05
(I'm assuming it's really HTTP::Tiny items not getting closed) 20:06
ugexe It’s almost certainly socket handles and the way that module handles it 20:17
You can probably manually close the connections yourself instead of relying on the module to handle it automatically 20:18
[Coke] The handle in HTTP::Tiny is a private attribute, unfortunately. 20:27
will poke around.
Cro::HTTP::Client seems more robust, unsurprisingly. 20:38
[Coke] (And faster) 20:43
[Coke] so easy to handle 429 errors with cro & raku. woot 21:12
[Coke] # X::Cro::HTTP2::GoAway+{X::Await::Died} 21:26
Getting that on occasional runs of the link checker. 21:27
Looking at old cro logs, looks like maybe I should just retry when I get one. 21:29
wayland tell tbrowder tbrowder do you mean that we have a shorter version than what lizmat wrote above? 22:51
.tell tbrowder tbrowder do you mean that we have a shorter version than what lizmat wrote above? 22:52
tellable6 wayland, I'll pass your message to tbrowder