🦋 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.
japhb [Coke]: You invoked? What can I help with? 00:21
[Coke] .tell thundergnat Terminal::ReadKey does not work here, no 00:50
tellable6 [Coke], I'll pass your message to thundergnat
[Coke] same as the other one, i have to hit enter 00:51
japhb Dangit, looks like I keep missing you [Coke] 01:54
So just from scrollback: Yeah, there are several ways to get raw terminal input, though at this point it's likely that I have produced a rocket-powered warhammer of ridiculousness when you just need something to put in a finishing nail. 02:00
The simplest version I have around is github.com/ab5tract/Terminal-Print...wInput.pm6 02:03
japhb It doesn't parse the keys that are sent as escape codes; for that you'd need github.com/ab5tract/Terminal-Print...dInput.pm6 or better yet to use the more advanced, ANSI-correct stuff I do for Terminal-LineEditor 02:04
Voldenet lizmat: Nice api, and I think multiple dispatch is pointless with most libs using C-style 05:48
I'm guessing it would work with cpp libs, but it's probably not worth the effort 05:51
especially considering that most useful libs also have C apis 05:54
lizmat weekly: final Comma Complete release available for download by all commaide.com/download 11:26
notable6 lizmat, Noted! (weekly)
lizmat weekly: news.ycombinator.com/item?id=39395897 12:14
notable6 lizmat, Noted! (weekly)
cokebot9000 Looking at things from the discord side, is #raku the only bridged channel at this point? 14:36
lizmat #raku-beginner as well
[Coke] oh, maybe beginner also? (confusingly not listed under the "irc bridges" folder" 14:37
tbrowder__ hi, i'm trying to break down a JSON::Fast hash of stuff and the key -> hash parts work fine. but two chunks are weird and i can't decode it. i'll gist the dd output i got in just a moment... 14:40
www.irccloud.com/pastebin/qMw3qTby/ 14:45
i can see 'lat' but can't get its value
lizmat %data<lat> should do it ? 14:46
also, you might want to add :immutable to the from-json call
that is, if you're not going to change %data 14:47
tbrowder__ ok, i'll do that... 14:59
before i get to it, shouldn't File::Temp be a community module? I'll be happy to help, i pushed PR to 2colour's fork, but... 15:01
lizmat probably 15:04
tbrowder__ lizmat: that worked fine, thank you! (i coulf 15:05
*not seeing forest for the trees!
[Coke] japhb: raw.githubusercontent.com/ab5tract...d-input.p6 was very helpful, thank you 15:37
japhb: however, now all my prints are online moving to the next line, not doing a carriage return. Any thoughts? 15:44
*only 15:45
major change was that I added use Terminal::Print::DecodedInput in a module and added an our $in-supply = decoded-input-supply;
if I manually add \rs it works again. :| 15:46
[Coke] .tell japhb github.com/ab5tract/Terminal-Print/issues/83 16:01
tellable6 [Coke], I'll pass your message to japhb
japhb [Coke]: Answer in the issue. Let me know if you need more detail. :-) 16:10
[Coke] japhb: is there a way to use Terminal::Print to switch between raw and not? 16:16
[Coke] eh. I only have a few says, easy enough to wrap. Thanks. 16:24
japhb: the input supply seems to take over input for the entire program. 16:31
I have some prompt() calls after that, and they are fubar now
I assume I just need to go all in if I'm using Terminal::Print. :( 16:32
[Coke] (which is fine, was heading there anyway) 16:33
japhb [Coke]: Yes, can close the raw supply and just open a new one when you want it again. 16:37
If you want to be prompting, perhaps you want Terminal::LineEditor? It uses the newer version of the algorithms in Terminal::Print. (The newer versions handle a lot more of the full ANSI escape sequence space.) 16:38
[Coke] Supply doesn't have a close. 16:40
Ugh.
ok. Setting this aside for now so I don't have to rip out the code I just wrote. :) 16:41
japhb Fair. Feels like there's (yet another' 16:43
) Terminal module I need to write.
*sigh*
[Coke] eh. not your fault. I started out with something simple that was just printing to the screen and using prompt(), and am slowing making it into something that really wants more features, and I'm just at the steep point right now. no worries. 16:53
I probably do want Terminal::Print if I understand it, because this will basically be redrawing the terminal each time to render a game.
and yes I know you have a whole thing for games but that is waaaay too much at this stage. :)
melezhik o/ 18:27