🦋 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.
ToddAndMargo native call question:  how do I declare a pointer to a pointer (*ppSession)? 01:53
my $ppSession  = NativeCall::Types::Pointer[NativeCall::Types::Pointer].new();
give me a bogus value 01:54
Is there a way to do this with NativeCast? 02:37
Kaiepi .tell jjmerelo is there time for a short-ish draft or two for advent? 06:16
tellable6 Kaiepi, I'll pass your message to jmerelo
Kaiepi uh
oh that is his nick 06:17
huh
sarna docs.raku.org/routine/spurt says that "spurting a Blob when the handle is NOT in binary mode is undefined" - what if I spurt a Blob to `$*OUT`? as per `IO::Special` docs, its `.mode` will always return Nil 10:51
am I missing something?
sarna it seems to work fine, but in docs there are also examples of subs called on `$*IN` where "Attempting to call this method when the handle is in binary mode will result in X::IO::BinaryMode exception being thrown." 10:58
so I think it can't be in binary mode, right? am I invoking UB? 10:59
Nemokosch that wouldn't make a whole lot of sense, to be honest; because by the same reasoning, spurting textual content to $*OUT would also be UB 11:02
which is nonsense
sarna why would that be? spurting a Cool is okay iff the handle is not in binary mode (as per docs) 11:04
Nemokosch ż as per IO::Special docs, its .mode will always return Nil
sarna ah, that. yeah.. I'm confused 11:05
Nemokosch I'm leaning towards the documentation is wrong. But what is right then, I don't know.
sarna for now I'll do `temp $*OUT = open '/dev/stdout', :w, :bin` 11:06
ahh, `.mode` refers to the permissions, not binary or not binary. like `0644`. now it makes sense why it's Nil for `$*OUT` 11:09
but now.. if I have a filehandle, can I tell if `:bin` was passed when it was created? there's no `.bin` method
sarna ahh, it needs to be an `IO::Handle` and not `IO::Path`. `.encoding` needs to return Nil. this is hard >:( 11:15
Nemokosch I can't follow you for sure xD 11:16
sarna yea sorry. in short, this works for ensuring the handle you get is in binary mode (so it's safe to spurt a Blob there): `$handle.encoding === Nil` 11:20
Nemokosch it's strange that there is no interface for this... 11:21
sarna if you find one, let me know :) 11:22
Nemokosch okay 😄
Nemokosch .seen japhb 11:25
tellable6 Nemokosch, I saw japhb 2022-11-24T18:28:52Z in #raku-dev: <japhb> Yeah, that's my guess, forced pushes
Nemokosch I wouldn't want to open an issue for this because I'm not sure if this is a legit thing to do in the first place...
.tell japhb in Terminal::LineEditor, if you do something like $*IN.lines, you get a prompt that you can finish with ctrl+d, however, it's not possible to get input for the console anymore afterwards, and it needs to be killed. Is this something intrinsic for how the REPL works or can it be fixed? 11:27
tellable6 Nemokosch, I'll pass your message to japhb
ToddAndMargo NativeCall pointer questions: I got it working. 17:05
smol-hors henlo 21:00
Nemokosch suppers 21:02
Voldenet ehlo 21:38