🦋 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.
00:01 SystemFFan left, lichtkind left 00:02 reportable6 left 00:05 reportable6 joined 00:41 Maylay left 00:44 Maylay joined
Xliff Can rakudo do Twig? 00:55
[Coke] would you expect the code in the twig templates to be raku? 01:25
modules.raku.org/search/?q=template has a few templating options. 01:26
cro.services/docs/reference/cro-webapp-template also may be of interest. 01:28
01:44 evalable6 left, linkable6 left 02:18 Xliff_ joined 02:19 Xliff left 02:21 simcop2387 left, perlbot left 02:23 frost joined 02:27 Xliff_ left 02:36 perlbot joined 02:38 simcop2387 joined 02:45 evalable6 joined 03:08 aleksb joined 03:13 rakuUser left 03:29 keutoi left 03:31 keutoi joined 03:36 clarjon1 joined 04:36 committable6 left, nativecallable6 left, coverable6 left, squashable6 left, benchable6 left, bisectable6 left, shareable6 left, unicodable6 left, notable6 left, releasable6 left, evalable6 left, sourceable6 left, quotable6 left, bloatable6 left, statisfiable6 left, greppable6 left, reportable6 left, tellable6 left, bloatable6 joined, nativecallable6 joined 04:37 reportable6 joined, quotable6 joined, Xliff joined, greppable6 joined 04:38 evalable6 joined, squashable6 joined, unicodable6 joined, notable6 joined, statisfiable6 joined 04:39 homura joined, tellable6 joined 04:47 linkable6 joined 04:53 kjp left 04:55 kjp joined 05:17 homura left, homura joined 05:36 committable6 joined 05:37 bisectable6 joined 06:02 reportable6 left 06:03 reportable6 joined 06:18 Sgeo left 06:34 Summer left, Summer joined 06:35 Altai-man joined 06:36 Altai-man left 06:37 sourceable6 joined 06:38 shareable6 joined 06:39 Altai-man joined 07:01 keutoi left 07:11 lichtkind joined 07:13 keutoi joined 07:35 yggdrasil63 joined 07:38 benchable6 joined 07:39 releasable6 joined 07:40 aleksb left 07:47 keutoi left 08:42 holyghost joined 08:54 MoC joined
yggdrasil63 m: say 13.^methods; 08:56
camelia (new Capture Int sign Num Rat FatRat abs Bridge sqrt base polymod expmod is-prime floor ceiling round lsb msb narrow Range conj rand sin asin cos acos tan atan atan2 sec asec cosec acosec cotan acotan sinh asinh cosh acosh tanh atanh sech asech cosech…
yggdrasil63 m: say "z1".succ; 08:57
camelia z2
yggdrasil63 m: say "/".succ;
camelia /
yggdrasil63 m: say "?".succ; 08:58
camelia ?
yggdrasil63 m: say "..".succ;
camelia ..
yggdrasil63 m: say $*DISTRO; 09:01
camelia opensuse-leap (15.2)
09:22 lizmat left 09:23 lizmat joined, TempIRCLogger__ joined 09:25 TempIRCLogger left
yggdrasil63 m: say "z1".succ.succ; 09:28
camelia z3
yggdrasil63 m: say "a".prev; 09:29
camelia No such method 'prev' for invocant of type 'Str'. Did you mean any of
these: 'grep', 'pred', 'tree'?
in block <unit> at <tmp> line 1
yggdrasil63 m: say "a".pred;
camelia Decrement out of range
in block <unit> at <tmp> line 1
yggdrasil63 m: say "/".pred;
camelia /
lizmat yggdrasil63: "/" is not magical 09:35
m: say "B".prev
camelia No such method 'prev' for invocant of type 'Str'. Did you mean any of
these: 'grep', 'pred', 'tree'?
in block <unit> at <tmp> line 1
lizmat m: say "B".pred
camelia A
lizmat :-)
09:38 coverable6 joined
yggdrasil63 lizmat: I was just wondering what would happen for symbols when you call .succ or .pred 09:39
m: say "B".pred; 09:40
camelia A
yggdrasil63 m: say "&".pred;
camelia &
lizmat m: say "&".ord.pred.chr
camelia %
lizmat that would be more general :-) 09:41
yggdrasil63 Interesting 09:47
m: say "«".ord.prev.chr 09:48
camelia No such method 'prev' for invocant of type 'Int'. Did you mean any of
these: 'grep', 'pred', 'tree'?
in block <unit> at <tmp> line 1
yggdrasil63 m: say "«".ord.pred.chr
camelia ª
yggdrasil63 Ha!
Very interesting language.
lizmat thank you :-)
yggdrasil63 m: say "«".ord.succ.chr 09:49
09:49 Nih joined
camelia ¬ 09:49
09:49 Nih left
yggdrasil63 m: subset zero-integer of Int where * = 0; my zero-integer i = 1; say i ; 09:51
camelia 5===SORRY!5=== Error while compiling <tmp>
Multiple prefix constraints not yet implemented. Sorry.
at <tmp>:1
------> 3er of Int where * = 0; my zero-integer i7⏏5 = 1; say i ;
yggdrasil63 Does where support multiple clauses? 09:53
x` 10:01
frost m: subset zero-integer of Int where * = 0; my zero-integer $i = 1; say $i ; 10:07
camelia Cannot modify an immutable Whatever (*)
in block <unit> at <tmp> line 1
frost m: subset zero-integer of Int where * == 0; my zero-integer $i = 1; say $i ;
camelia Type check failed in assignment to $i; expected zero-integer but got Int (1)
in block <unit> at <tmp> line 1
frost m: subset zero-integer of Int where * == 0; my zero-integer $i = 0; say $i ;
camelia 0
10:10 keutoi joined
raydiak yggdrasil63: you can compare against multiple values with junctions, or you can do more complex logic using the block form instead of the whatever star 10:12
e.g. `where * == 0|1`, or `where { $_ == 0 || $_ == 1 }` 10:15
Xliff /j #cro 10:17
10:18 lichtkind left
keutoi I am not sure how `sub MAIN` is being dispatched, but why doesn't this work `sub MAIN(@a)` while `sub MAIN(*@a)` works? 10:43
lizmat keutoi: you cannot specify an array on the commandline 10:46
you *can* specify multiple named arguments on the command line
so something like sub MAIN(:@foo) would work with --foo=a --foo=b 10:47
you *can* specify (unnamed) arguments on the command line, but they'd be interpreted as multiple single values 10:48
so sub MAIN($a,$b) for two values
if you don't know the number of values you're going to get, you need a slurpy array
keutoi So there is no situation in which `sub MAIN(@a)` definition actually works, right? 10:49
lizmat I don't think so, but would gladly be proven wrong :-) 10:50
keutoi We might need that clarification in language/create-cli. 10:52
Geth doc: k3ut0i++ created pull request #3949:
passing indeterminate number of parameters to MAIN
10:58
11:18 linkable6 left, evalable6 left 11:19 evalable6 joined 11:21 avar left 11:22 jaguart left
yggdrasil63 :frost :raydiak thanks for the clarification. 11:44
12:02 reportable6 left 12:05 reportable6 joined 12:10 yggdrasil63 left
tbrowder hi, all 12:14
12:15 rakuUser joined 12:17 keutoi left, keutoi joined 12:20 linkable6 joined
tbrowder not quite raku related, but is there a mac user here who has installed user TLS/SLS certificate for use in accessing private areas of websites who would be willing to help a friend of mine (located in us mountain time zone) with his problem? 12:21
i don't have access to a mac so it's difficult to debug over the phone and we don't have a way to see his screen. 12:22
pls contact me by private msg if interested, thanks. 12:23
but re raku, i am using raku in creating web maps on my websites using tomtom maps SDK 12:26
12:28 avar joined 12:33 Doc_Holliwood joined
Doc_Holliwood Would it be possible to modify the regex engine so that it operates on lists of characters as input instead of strings? 12:33
12:42 frost left
moritz_ with enough work put in, that would be possible 13:09
13:14 PotatoGim left 13:15 PotatoGim joined 13:23 tbrowder left, tbrowder joined 14:02 Sgeo joined
tib Hello, a tentative planning for the ephemeral miniconf: dev.to/thibaultduponchelle/the-eph...anning-aom normal slots are full, still looking for lightning talks speakers :) 14:03
codesections are `my @l := (1, 2, 3)` and `my @l is List = (1, 2, 3)` exactly the same, or is there a semantic difference that I'm missing? 14:09
ugexe seems that way for the most part, but for instance: 14:15
m: my @a := (1,2,3); my @b is List = (1,2,3); @a := 1
camelia Type check failed in binding; expected Positional but got Int (1)
in block <unit> at <tmp> line 1
ugexe m: my @a := (1,2,3); my @b is List = (1,2,3); @b := 1
camelia Type check failed in binding; expected List but got Int (1)
in block <unit> at <tmp> line 1
14:16 b2gills left, b2gills joined
codesections Interesting 14:17
ugexe that comment does help me internalize golangs := a bit better though 14:18
14:20 Doc_Holliwood left 14:23 keutoi left 14:24 neither joined 14:25 keutoi joined 14:39 MoC left 14:47 Doc_Holliwood joined 14:58 doconthe1ocks left 14:59 keutoi left 15:02 homura left
Geth doc/rx-adverbs: 5e54c056ff | (Daniel Sockwell)++ (committed using GitHub Web editor) | doc/Language/regexes.pod6
Clarify where rx declarator allows adverbs

A regex declared with `rx` allows adverbs both before the delimiter (`rx:s/pattern/`) and after (`rx/:s pattern/`), but the docs only mentioned the first option. This fixes that, and brings the rx section of the page into alignment with the adverb section.
15:08
15:08 neither left
Geth doc: codesections++ created pull request #3951:
Clarify where rx declarator allows adverbs
15:08
15:44 holyghost left
Geth doc: e223f5e11a | keutoi++ (committed by Juan Julián Merelo Guervós) | doc/Language/create-cli.pod6
passing indeterminate number of parameters to MAIN
15:46
linkable6 Link: docs.raku.org/language/create-cli
15:54 Doc_Holliwood left 16:22 archenoth joined 16:25 keutoi joined 16:28 Guest59 joined 16:34 Guest59 left 16:35 Guest20 joined, Guest20 left 16:51 Guest92 joined, Guest92 left 17:21 Doc_Holliwood joined 17:31 Guest26 joined 17:33 Guest26 left 18:02 neither joined, reportable6 left 18:08 patrickb joined 18:22 keutoi left 18:32 neither64 joined 18:33 neither64 left 18:34 Doc_Holliwood left 18:38 lichtkind joined 18:45 Doc_Holliwood joined 18:47 neither31 joined
neither31 hi, is `$obj.WHAT.new` an idiomatic way to make a new object as the same type as `$obj`? 18:58
MasterDuke seems like a decent way to me 18:59
codesections I don't think I've ever needed to do that, so I'm not sure… 19:00
lizmat I think for most core classes, you can leave out the .WHAT
codesections but wouldn't $obj.new also work unless it's a very strangely constructed object?
lizmat for custom classes: if a new does does something different if the invocant is an instance, 19:01
then who knows
most classes I know of, don't make the distinction
codesections yeah, that's what I meant by "very strangely constructed" :D
ugexe .WHAT.clone is another option although i dont see why it would be better than the other options 19:07
lizmat cloning a type object ??
moon-child neither31: you can just use $obj.new 19:08
oh, already suggested
ugexe cloning a type object is the first example shown for docs.raku.org/routine/clone#class_Mu
moon-child 'Note that .clone does not go the extra mile to shallow-copy @. and %. sigiled attributes' should that not be 'deep-copy'? 19:09
codesections ugexe yeah, but that example dies… 19:10
ugexe because its being passed incorrect arguments
m: say Num.clone
camelia (Num)
codesections m: say Num.clone(4) 19:11
camelia Cannot resolve caller clone(Num:U: Int:D); none of these signatures match:
(Mu:U: *%twiddles)
(Mu:D: *%twiddles)
in block <unit> at <tmp> line 1
codesections m: say Num.clone.new(4)
camelia 4
codesections but why not just do Num.new ?
ugexe well i did say i dont see why it would be better than .new 19:14
codesections fair :)
neither Oh I didn't even think of `$obj.new` as I was looking for a class method
But still, with WHAT intent is more clear IMHO 19:15
Thanks
19:16 patrickb left
MasterDuke yeah, i rarely prefer something longer over shorter, but i think i would in this case 19:19
19:43 Xliff left 20:23 squashable6 left 20:24 squashable6 joined 20:29 neither left, neither31 left 21:02 Doc_Holliwood left 21:19 melezhik joined
melezhik . 21:19
21:25 melezhik left
moon-child m: gather { ^5 .map: &take } 21:27
camelia ( no output )
moon-child m: say gather { ^5 .map: &take }
camelia (0 1 2 3 4)
moon-child m: say [[1, 2, 3], [4, 5, 6], [7, 8, 9]][;0] 21:48
camelia Use of Nil.Int coerced to empty string
(1)
in block <unit> at <tmp> line 1
moon-child why doesn't ^^ work?
m: say [[1, 2, 3], [4, 5, 6], [7, 8, 9]][*;0]
camelia (1 4 7)
moon-child can do ^^ instead, but it's less pretty 21:49
m: say [[1], ['1'], [4]].unique(:as(&map.assuming(&[~])), :with(&[eqv])) 22:24
camelia The iterator of this Seq is already in use/consumed by another Seq (you
might solve this by adding .cache on usages of the Seq, or by assigning
the Seq into an array)
in block <unit> at <tmp> line 1
moon-child why??
22:25 evalable6 left, linkable6 left 22:26 evalable6 joined 22:36 codesections left
ugexe if there is a problem with code that uses 'assuming' then 'assuming' is probably the problem 22:36
22:36 lichtkind left
ugexe the implementation is... well you can look for yourself 22:37
moon-child m: say [[1], ['1'], [4]].unique(:as(*.map(&[~]), :with(&[eqv])) 22:40
camelia 5===SORRY!5=== Error while compiling <tmp>
Unable to parse expression in argument list; couldn't find final ')' (corresponding starter was at line 1)
at <tmp>:1
------> 3].unique(:as(*.map(&[~]), :with(&[eqv]))7⏏5<EOL>
moon-child m: say [[1], ['1'], [4]].unique(:as(*.map(&[~])), :with(&[eqv]))
camelia The iterator of this Seq is already in use/consumed by another Seq (you
might solve this by adding .cache on usages of the Seq, or by assigning
the Seq into an array)
in block <unit> at <tmp> line 1
moon-child ugexe: same result without assuming
ugexe i should have known i was wrong when it didnt rhyme
moon-child lol 22:42
and yeah, I noticed the implementation of assuming was ... shoddy. But doesn't seem to be the problem in this case!
23:03 reportable6 joined
gfldex m: sub foo { "Good &:greeting(now.DateTime.hour) $:name!" }; say foo :name<Paul>, :greeting{$_ < 12 ?? 'morning' !! 'day'}; say &foo.signature; 23:08
camelia Good day Paul!
(:&greeting!, :$name!)
gfldex I think that's an ENODOC.
At least &: is not in the index. And I can't find named &-sigiled placeholder vars. 23:21
&^ is not in the index either.
23:27 linkable6 joined