🦋 Welcome to the MAIN() IRC channel of the Raku Programming Language (raku.org). This channel is logged for the purpose of keeping a history about its development | evalbot usage: 'm: say 3;' or /msg camelia m: ... | Log inspection is getting closer to beta. If you're a beginner, you can also check out the #raku-beginner channel!
Set by lizmat on 25 August 2021.
melezhik . 00:20
nine It's shared. 07:32
In practice, most of the time things start to build immediately.
Geth ¦ App-Rakubrew: patrickbkr self-assigned "unauthenticated git protocol no longer supported" github.com/Raku/App-Rakubrew/issues/48 07:39
suman m: my @a=[1,2,3,4]; 08:12
camelia ( no output )
suman Is there a way to test if the giveb list is all composed  of integers or num or rat ? 08:13
MasterDuke m: my @a = [1,2e2,3.3]; say all(@a) ~~ Numeric; my @b = [1,2e2,3.3,"str"]; say all(@b) ~~ Numeric; 08:22
camelia True
False
suman MasterDuke my goal is to test if the list is made of ints or num, accordingly i can pass the list/array to nativecall. If I test individual items then it would be O(n). can it be done in O(1) time. 08:33
MasterDuke sort of 08:34
m: my int @a = 1,2; say @a.of 08:35
camelia (int)
MasterDuke if the array is parameterized, you can check what it was parameterized as with `.of`. if it isn't parameterized, but you just want to check that all the elements are ok, you're pretty much stuck at O(n) 08:37
m: sub foo(@a) { say @a.of; say @a }; foo([1, 2]); my int @n = 2,3; foo(@n) 08:39
camelia (Mu)
[1 2]
(int)
[2 3]
lizmat m: dd (1,2,3,"foo").are 08:47
camelia Cool
lizmat m: dd (1,2,3).are
camelia Int
lizmat m: dd (1,2,3,3.4).are
camelia Real
lizmat suman MasterDuke ^^
MasterDuke doh, forgot that was added
lizmat m: dd (1,2,3,3.4,Date.today).are 08:48
camelia Any
CIAvash oh! `infer` was changed to `are`? Is it part of Raku or just Rakudo? 09:35
lizmat I think it's Raku now 09:40
although I just noticed it's not been added to the docs yet 09:41
nor are there any spectests yet
lizmat clickbaits rakudoweekly.blog/2022/03/21/2022-...easomatic/ 13:09
[Coke] good tutorial on Raku OO? I am trying to follow the BUILD/TWEAK examples for a simple class and passing in an attribute in the constructor doesn't seem to be working. 14:48
AHAHAHA. because I'm an idiot. 14:49
nevermind. :)
... crud. the powershell command to get the window size seems to be reporting on it as if it were a brand new powershell, not whatever the current terminal (in my case, a git bash terminal) is 14:57
works just fine if my terminal is already a powershell, unsurprisingly. 14:59
vrurg_ [Coke]: $COLUMNS? 15:00
vrurg %*ENV<COLUMNS> I mean. :) 15:01
[Coke] doesn't exist on windows 15:05
best I've found is: powershell -command '&{(get-host)).ui.rawui.WindowSize;}' 15:07
[Coke] ah, tput works on git bash 15:22
[Coke] docs.raku.org/language/concurrency#Locks - This example is unlikely to trigger the issue the lock is protecting against. should make it ^1000 and remove the sleep, yes? 16:11
[Coke] ... actually, tempting to make it a race. 16:17
guifa needs a cool title for his PRC talk 16:43
it's gonna be about reusing grammars inside of other grammars
lizmat Grammarly Grammaring 16:48
[Coke] somehow work in a Kelsey Grammer joke? 16:53
guifa Grammarly ™̸ Grammaring to avoid legal trouble? 16:55
Voldenet [Coke]: you can get columns in powershell using nativecall 18:41
like this: ix.io/3Tcb 18:42
Voldenet i've skipped the error handling, but basically GetConsoleScreenBufferInfo returns 0 on fail, so there's nothing much in it 18:51
vrurg [Coke]: Sorry, I was away. I know Win doesn't have $COLUMNS, but as long as you mentioned bash I thought it does it for user. 19:38
[Coke] git bash doesn't, no 19:41
tmux is fine. I assume that your solution is using the same as my powershell call, which would return the wrong numbers. 19:42
and it's got the advantage of being less code.
unfortunately, while my standalone version of the viewport worked, it looks like it's not working when I try to integrate it with actual code. blah.