🦋 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.
jdv i find it interesting that codesections asked if anyone wanted to join the grants commitee and i replied and i never heard back after that 00:31
fire and forget what that's what you get i guess:) 00:32
antononcube @tbrowder I implemented the Bulgarian numeric word forms generation tonight (in “Lingua::NumericWordForms”.) So, my interest in "Lingua::Number" is no more than 12%. 03:11
melezhik o/ 06:33
I've started to work on abother Sparky post related to kubernetets, if someone is interested , the draft is here - dev.to/melezhik/sparky-hacking-min...d7b8e500ac 06:34
ab5tract wayland76: why would the use of | be a requirement for using RakuAST? Your code could have used unshift, for example 06:43
tellable6 ab5tract, I'll pass your message to wayland76
librasteve [Coke]: ahhhh - sorry I have been juggling Chrome-Safari-Firefox and then did a hard reset on them to rule out a browser cache issue for $day-job ... you are quite right, that it is usually just a one off ... red face 11:05
tellable6 2024-06-04T22:09:27Z #raku <[Coke]> librasteve It should show up once and never again. It was designed to be as minimal as possible. Can you be more specific about what's annoying?
tbrowder [Coke]: i agree with yr doc chng. i just commented. 11:16
tbrowder fyi, my interest in that link thing, which i haven't tested yet, is how the link to another pod document will render with pdf documents. i need to discuss that with david warring. that may then be worth a small note in the link section. 11:22
what i'm looking for is how to "include" a pod document in another. that can be done mechanically with one's own tools. maybe i'm looking for a new formatting code for pod 2.0 to do that 11:27
*done now mechanically 11:28
librasteve wayland76: on tables, you may want to look at raku.land/zef:librasteve/Dan (essentially DataFrames for raku) - don't know if that's any use since dataframes are column oriented and the current implementation is not to type check ... 11:32
... that means if you go my \s = Series.new( data => [1, 3, 5, NaN, 6, 8], index => <a b c d e f>, name => 'john' ); say s.dtype;, then it will give back s.data.are; in this case Num.... 11:35
... the general design idea is to have a pure raku DataFrame than can then be imported into a Pandas or Polars dataframe wholesale. 11:43
now, if memory serves I did sketch out some ideas on how to wrap up Dan series and dataframes to control types - best examples are conf.raku.org/talk/171 at around 17:32 11:45
anyway not sure if that is any use at all to your question ... it sounds like Captures are a cool way to do that 11:48
[Coke] tbrowder: I think you might want P<>? 12:55
tbrowder hm, let see... 13:32
tbrowder ah, yes. NYI. one i wanted to implement but life... 13:35
changing in gamma to =place ?
thanks for reminder 13:36
antononcube @librasteve It seems to me that the package "Data::TypeSystem" can be used to check data-frames column types. Here is a demo -- a tabular dataset is made then it is transposed into a data frame: 13:45
cdn.discordapp.com/attachments/633...34ced&
tbrowder when using a JSON::Fast hash key $k with value , say, "0", how can i coerce it to its Int value? 14:04
lizmat +.value? 14:05
tbrowder m: my $a = "0"; say $a.value
camelia No such method 'value' for string '0'. Did you mean 'values'?
in block <unit> at <tmp> line 1
tbrowder m: my $a = "0"; say +$a.value 14:06
camelia No such method 'value' for string '0'. Did you mean 'values'?
in block <unit> at <tmp> line 1
lizmat in that case: +$a 14:07
got confused by your mention of a hash
tbrowder m: my $a = "0"; say +$a
camelia 0
lizmat m: my $a = "0"; say +$a
camelia 0
tbrowder thanks!
lizmat m: my $a = "0"; dd +$a
camelia 0
lizmat m: my $a = "0"; dd (+$a).^name 14:08
camelia "Int"
tbrowder 👍
hm, i need to assign the int value to an actual int var. 14:12
m: my $s = "0"; my $n = +$s;
camelia ( no output )
tbrowder m: my $s = "0"; my $n = +$s; say $n 14:13
camelia 0
tbrowder hm, that does work! gut! 14:14
in my code i was looking at the wrong set of keys,, 14:17
duh...
trying to simplify with: $k .=+ and i get err msg "expecting dotty method or postfix 14:25
m: my $k = "0"; $k .=+ 14:26
camelia ===SORRY!=== Error while compiling <tmp>
Missing required term after infix
at <tmp>:1
------> my $k = "0"; $k .=⏏+
expecting any of:
dotty method or postfix
tbrowder m: my $k = "0"; +($k); say $k 14:27
camelia WARNINGS for <tmp>:
0
Useless use of "+" in expression "+($k)" in sink context (line 1)
tbrowder m: my $k = "0"; $k .= +$k; say $k 14:28
camelia ===SORRY!=== Error while compiling <tmp>
Missing required term after infix
at <tmp>:1
------> my $k = "0"; $k .=⏏ +$k; say $k
expecting any of:
dotty method or postfix
dakkar `prefix:<+>` is a multi sub, not a method, so you can't call it with the dot 14:29
tbrowder m: my $k = "0"; $k = +$k; say $k;
camelia 0
dakkar but you can call the `Numeric` method
tbrowder best i can do
dakkar m: my $k='010'; $k .= Numeric; say $k
camelia 10
tbrowder dakkar, thanks! 14:30
dakkar just grepping the source 😁
tbrowder yeah, docs need a tweak there with practical example 14:31
[Coke] Anyone has a suggestion, PRs welcome on raku/docs 17:52
tbrowder wilco 18:34
m: my $a = 00_00; $a .= Numeric; say $a 18:37
camelia Potential difficulties:
Leading 0 has no meaning. If you meant to create an octal number, use
'0o' prefix; like, '0o0_00'. If you meant to create a string, please
add quotation marks.
at <tmp>:1
------> my $a = 00_00…
tbrowder m: my $a = 00_00; say $a.^name 18:38
camelia Potential difficulties:
Leading 0 has no meaning. If you meant to create an octal number, use
'0o' prefix; like, '0o0_00'. If you meant to create a string, please
add quotation marks.
at <tmp>:1
------> my $a = 00_00…
tbrowder m: my $a = 100_000; say $a.^name 19:11
camelia Int
tbrowder m: my $a = 100_000.0; say $a.^name 19:12
camelia Rat
tbrowder m: my $a = 10_0.0; say $a.^name 19:13
camelia Rat
Xliff Good evening! 19:50
Is there a way to have coercion AND a subset?
So if I create a subset like so: my subset UBInt of Int where * ~~ 0 .. 255 19:51
Can I still do "UBInt() $a"? 19:52
m: my subset UBInt of Int where * ~~ 0 .. 255; sub a (UBInt() $b) { say $b }; a(π) 19:54
camelia 3
Xliff :O