Voldenet m: use NativeCall; my uint8 $x := CArray[uint8].new()[0]; 00:01
camelia 5===SORRY!5=== Error while compiling <tmp>
Cannot bind to natively typed variable '$x'; use assignment instead
at <tmp>:1
------> 3l; my uint8 $x := CArray[uint8].new()[0]7⏏5;
Voldenet m: use NativeCall; my Int $x := CArray[uint8].new()[0];
camelia ( no output )
00:04 dogbert17 joined 00:07 dogbert11 left, Xliff left 00:21 dogbert11 joined
veesh m: use NativeCall; my uint8 $x = CArray[uint8].new(255)[0] 00:23
camelia ( no output )
veesh oops, forgot to print
m: use NativeCall; my uint8 $x = CArray[uint8].new(255)[0]; say $x
camelia 255
00:23 dogbert17 left
veesh that's better 00:23
m: use NativeCall; my uint8 $x = CArray[uint8].new(255)[0]; d $x 00:24
camelia 5===SORRY!5=== Error while compiling <tmp>
Undeclared routine:
d used at line 1
00:24 Redfoxmoon left 00:27 Redfoxmoon joined
Voldenet actually 00:28
m: use NativeCall; my $x := CArray[uint8].new()[0]; say $x = 244
camelia -12
00:46 sena_kun left 00:56 Xliff joined 01:00 titsuki_ left 01:01 aborazmeh joined, aborazmeh left, aborazmeh joined, sena_kun joined 01:17 pierrot left 01:20 pierrot joined
TreyHarris veesh, fyi: "This is due to the fact that Natives don't know their types because they're just values, without any metadata. In multi-dispatch, you can have a native candidate, but you cannot differentiate different sizes of the same native type. That is, you can have an Int and int candidates, but there would be an ambiguity between, for instance int, atomicint or int64 candidates." 01:24
from docs.raku.org/language/nativetypes...ativetypes
oops
docs.raku.org/language/nativetypes
I mostly love working on an iPad Pro, but its Bluetooth keyboard handling is very, very sub-par 01:25
veesh: so long as the native value is assigned to a single scalar, Raku _could_ work around it by using the namespace's scratchpad (or its implementational equivalent); but as you've shown, once you put it into an array (or a struct or union) Raku permanently loses track of it in a way that would afford full multi support 01:27
01:29 __jrjsmrtn__ joined 01:30 _jrjsmrtn left 01:50 holli left 01:55 aborazmeh left 01:59 wildtrees left 02:17 molaf left 02:30 molaf joined 02:42 angelds joined
Geth doc: 5d568b3fd9 | (Trey Harris)++ | doc/Language/modules-core.pod6
Fix broken .pm6 → rakumod rakudo extlinks

External links to rakudo's GitHub repo using the old file extensions are broken. Fixed.
02:43
linkable6 Link: docs.raku.org/language/modules-core
02:45 sena_kun left 02:52 Xliff left 02:56 Xliff joined 02:59 sena_kun joined 03:12 molaf left 03:17 xinming_ left 03:18 xinming_ joined
Geth doc: 2ad2a1ee03 | (Trey Harris)++ | doc/Language/nativetypes.pod6
Document multi ambiguity between int and uint

As veesh++ points out, multis cannot distinguish between `int` and `uint` any more than they can distinguish between `int and `int64`.
03:38
linkable6 Link: docs.raku.org/language/nativetypes
03:44 Actualeyes joined 03:47 leont left 04:02 atroxaper joined 04:03 atroxaper left 04:21 holyghost left 04:22 holyghost joined 04:45 sena_kun left 04:58 mahmudov left 04:59 sena_kun joined 05:28 angelds left 05:32 ensamvarg joined 05:34 Redfoxmoon left, Redfoxmoon joined 06:16 holli joined 06:20 sauvin joined, xinming joined 06:23 xinming_ left, sno left 06:24 jmerelo joined, BlackWhite joined 06:25 BlackWhite left 06:26 cpan-raku left 06:30 kent\n joined 06:33 cpan-raku joined, cpan-raku left, cpan-raku joined 06:46 sena_kun left
cpan-raku New module released to CPAN! DateTime::Monotonic (0.0.6) by 03JMASLAK 06:48
06:57 rindolf joined 07:00 sena_kun joined
holyghost I'm busy on probability marginal functions and more Bayesian learning 07:05
The code is on Xliff's server, I'll put it on github next week 07:06
e.g. a posterior approximation
07:09 wamba joined 07:21 rindolf left 07:23 hacktor joined 07:25 rindolf joined 07:30 domidumont joined 07:31 holli left 07:40 raymze256 joined 07:42 raymze256 left 07:43 raymze256 joined 07:44 raymze256 left 07:46 hacktor left 07:48 sno joined 07:50 wamba left 07:52 darkstardevx joined 08:01 stoned75 left 08:03 Actualeyes left, Actualeyes joined 08:08 AlexDaniel joined, AlexDaniel left, AlexDaniel joined 08:11 xinming left 08:17 xinming joined 08:42 wamba joined 08:46 sena_kun left, xinming left, xinming joined 09:00 sena_kun joined, hacktor joined 09:10 hacktor left 09:12 holli joined 09:35 shred_alert joined 09:41 domidumont left 09:42 domidumont joined 09:43 zakharyas joined 09:56 hacktor joined
holyghost I've just updated code on github for p6-Game-Bayes and p6-Game-Stats, what I've talked of before 10:03
10:08 holli left 10:22 scimon joined 10:27 pecastro joined
holyghost I've still ot to process pmf (probability marginal function) into chaos stochastitical systems :-) 10:36
Anyway, it's easy enough 10:37
10:41 wamba left 10:45 sena_kun left 10:56 Doc_Holliwood joined 10:57 hacktor left 10:58 daxim left 11:00 domidumont left 11:01 sena_kun joined 11:02 daxim joined 11:19 patrickb joined 11:29 Black_Ribbon left, mowcat joined 11:33 Actualeyes left, Actualeyes joined, molaf joined
patrickb 🎺🎺🎺 ANNOUNCEMENT 🎺🎺🎺 11:36
The GSoC organization application deadline is in 4 days!
Those of you who are pondering of whether to mentor should make up their mind soon.
What you need to do when you want to mentor: Go to github.com/perl-foundation-outreac...2020-ideas and create a PR with your project idea listing you as a mentor.
It is fine to list multiple ideas and see which ones students apply for.
lizmat, brrt, jnthn, nine, samcv, vrurg, jmerelo, AlexDaniel, sena-kun, (whoever fells addressed): Kind reminder to make up your mind of whether you want to mentor and on what project. :-) 11:37
11:37 wamba joined
lizmat I haz project ideas, but am hesitant about being a mentor 11:37
patrickb ^^
patrickb lizmat: I'm not sure who, but I seem to remember people willing to mentor but not having ideas... 11:38
11:39 Doc_Holliwood left
patrickb lizmat: Also, can we do something about your hesitation? I think it's very ok not to mentor, but it'd be sad to not make up ones mind in time. 11:42
lizmat patrickb: consider you've done something :-) 11:43
11:44 Doc_Holliwood joined 11:45 hacktor joined
sarna hi, what’s the current extension for scripts? still .p6? 11:45
11:48 Actualeyes left 11:49 Actualeyes joined, hacktor left
lizmat .raku but only if you have a modern enough Rakudo (2019.11 or later) 11:49
sarna oh neat! thanks 11:50
11:52 colomon joined
jmerelo patrickb: thanks for the reminder 11:56
patrickb: I pretty much have my mind made
patrickb jmerelo: You also already have project ideas on the ideas page :-)
jmerelo lizmat: you can propose a project anyway, maybe someone else will take it up as a mentor. I mean, mentors do not have to be tied to projects...
patrickb: but we _do_ need more. 11:57
patrickb: also, we need to start filling the application. Maybe this weekend in Fosdem Makoto and me can do it.
11:57 colomon left 11:58 colomon_ joined
patrickb jmerelo: Great that you are on this! 12:01
jmerelo: Do you intend to change the the project page to how last years page looked? It seems the page is currently mostly targeted to mentors.
sarna how to get an array filled with x 0s? I can’t find anything in the docs, hmm 12:04
lizmat m: my @a is default(0); say @a[9999] 12:05
scimon m: my @a = 0 xx 10;say @a;
camelia 0
[0 0 0 0 0 0 0 0 0 0]
scimon :D
sarna oh neat, thanks :)
jmerelo patrickb: we're still in that phase... We might change it later on, when/if it's accepted 12:06
lizmat sarna: using "is default(0)" is O1, rather than On
patrickb jmerelo: OK, that's what I thought. :-)
sarna lizmat: nice, thanks! 12:09
I’ve noticed some funky behavior though
lizmat sarna: with "is default()" ? 12:10
sarna m: my @a is default([0;0;0]); say @a; @a[0][1] = 3; say @a; say @a[0]
camelia []
[]
[0 3 0]
sarna why is @a after the modification just an empty array?
scimon Oooo I learnt something new today.
sarna (@a[0] is not, interestingly) 12:11
lizmat what you're doing there, is that you're making a shaped array to be the default of an element of the @a array 12:12
is default() is about the *elements* of an array, not about it's shape
sarna oh, hm. I’m trying to make an array of five [0;0;0]s 12:13
lizmat m: dd [0;0;0]
camelia Array element = [0, 0, 0]
lizmat hmmm 12:14
12:16 zakharyas left
sarna m: my @a = [[0 xx 3] xx 5]; dd @a 12:16
camelia Array @a = [[0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0]]
sarna this one works, but hm
lizmat sarna: thing is, that what you specify as the default, is a single instance of the value 12:17
12:18 wamba left
sarna oh 12:18
so when I modify it..
then rip :D
shred_alert I just had a eureka moment. If we're generating an instance of some app from a template that template can also be used as a database for information about attributes of generated app. 12:22
Assuming the attributes stay in the same state throughout the lifetime of the generated app
Context: generating VMs from a template. 12:23
12:24 leont joined, aluaces left 12:30 domidumont joined 12:34 aluaces joined 12:38 hacktor joined 12:40 sno left 12:44 Doc_Holliwood left 12:45 Actualeyes left, Actualeyes joined 12:46 sena_kun left 12:57 Doc_Holliwood joined 12:59 abraxxa left 13:01 sena_kun joined 13:06 albongo joined, albongo left, albongo joined 13:07 titsuki_ joined 13:16 hacktor left 13:18 Maylay left 13:21 Maylay joined 13:29 lucasb joined 13:31 jmerelo left 13:40 Doc_Holliwould joined 13:41 Doc_Holliwood left 13:46 hacktor joined 13:48 uzl[m] joined
uzl[m] .tell jmerelo re documentable, I'll look at it later. In the meantime, since Git[lab|hub] always serve relative links in relation to username.gitlab.io unless they specify otherwise, I just created the following group gitlab.com/rakudocs and a repo which ends serving the site from rakudocs.gitlab.io/. 13:48
tellable6 uzl[m], I'll pass your message to jmerelo
13:50 mowcat left
uzl[m] Hi, everyone! I've been messing with the documentation's header layout and css. This is the result: rakudocs.gitlab.io/ 13:51
tellable6 2020-01-30T16:34:29Z #raku <jmerelo> uzl[m] I think there's this issue: github.com/Raku/Documentable/issues/78, very recent. Might that be the problem?
13:52 titsuki_ left 14:05 xinming left, xinming joined 14:06 gabiruh left, gabiruh joined
sarna uzl[m]: on mobile it’s a grey header with a very small camelia on the top left 14:07
14:07 hacktor left
[Coke] notes about layout/css - menu starts to vanish at smaller width. 14:14
I find it slightly pale for my taste, but that's just me. 14:15
14:15 Doc_Holliwould left
sarna m: my @foo = [1;2;3]; for @foo.kv <-> { say “won’t work” } 14:17
camelia Too many positionals passed; expected 0 arguments but got 1
in block <unit> at <tmp> line 1
14:17 sno joined
sarna can I somehow get the element as mutable and the key as immutable? 14:17
oh heck wait, my example was borked
<sarna> m: my @foo = [1;2;3]; for @foo.kv <-> $index, $val { say “won’t work” } 14:18
sarna sighs
m: my @foo = [1;2;3]; for @foo.kv <-> $index, $val { say “won’t work” }
camelia Parameter '$index' expected a writable container, but got Int value
in block <unit> at <tmp> line 1
sarna here
getting the key as mutable would be okay too of course 14:23
14:23 zakharyas joined
tobs m: my @foo = [1,2,3]; for @foo.kv -> $index, $val is rw { say "$i: ", $val *= 10 }; dd @foo 14:24
camelia 5===SORRY!5=== Error while compiling <tmp>
Variable '$i' is not declared
at <tmp>:1
------> 3or @foo.kv -> $index, $val is rw { say "7⏏5$i: ", $val *= 10 }; dd @foo
tobs m: my @foo = [1,2,3]; for @foo.kv -> $index, $val is rw { say "$index: ", $val *= 10 }; dd @foo
camelia 0: 10
Array @foo = [10, 20, 30]
1: 20
2: 30
tobs oh, dd goes to $*ERR, so the output is mixed up 14:25
sarna oh cool, thanks tobs 14:26
tobs sarna: not with <-> but with an is rw trait on the $value parameter to the loop body
14:26 hacktor joined
sarna yeah I think <-> puts rw on everything 14:26
tobs has never seen <-> before
sarna m: my @foo = [1;2;3]; for @foo <-> $number { $number += 1 }; dd @foo 14:27
camelia Array @foo = [2, 3, 4]
14:45 sena_kun left 14:53 metabind joined
metabind p6: Int.^name; 14:56
camelia ( no output )
metabind p6: say Int.^name;
camelia Int
metabind p6: put Int.^name; 14:57
camelia Int
14:57 hacktor left
metabind p6: put Int.^mro 14:58
camelia Use of uninitialized value of type Int in string context.
Methods .^name, .raku, .gist, or .say can be used to stringify it to something meaningful.

in block <unit> at <tmp> line 1
Use of uninitialized value of type Cool in string contex…
metabind p6: put Int.^methods
camelia Method object coerced to string (please use .gist or .raku to do that)
in block <unit> at <tmp> line 1
Method object coerced to string (please use .gist or .raku to do that)
in block <unit> at <tmp> line 1
Method object coerced to string (…
metabind p6: Int.^methods
camelia ( no output )
metabind p6: Int.^methods.gist 14:59
camelia ( no output )
15:00 sena_kun joined
metabind p6: 3.^name 15:00
camelia ( no output )
metabind p6: put 3.^name;
camelia Int
metabind p6: 3.isNaN
camelia ( no output )
metabind p6: say 5.isNaN 15:01
camelia False
metabind If I call Int.^methods, isNaN is listed as a method but it's not a method of any type listed in Int.^mro, and it's not listed as a method in the docs. 15:05
Why is that?
15:06 melezhik joined
[Coke] Int does Real 15:06
m: Int.^mro 15:07
camelia ( no output )
[Coke] m: dd Int.^mro
camelia (Int, Cool, Any, Mu)
[Coke] mro is showing you classes, not Roles.
metabind There is a section in the docs "routines supplied by role Real" that doesn't mention it
[Coke] can you open a bug at Raku/doc for that? 15:09
m: dd Int.^roles 15:10
camelia (Real, Numeric)
[Coke] m: dd Int.^roles[0].can('isNaN') 15:11
camelia (method isNaN (Real: *%_) { #`(Method|77915504) ... },)
vrurg m: dd Int.^mro: :roles 15:17
camelia Cannot find method 'raku' on 'Real': no method cache and no .^find_method
in block <unit> at <tmp> line 1
vrurg m: say .^name for Int.^mro: :roles
camelia Int
Real
Numeric
Cool
Any
Mu
vrurg [Coke]: ^^^
metabind What's the difference between p6 and dd? 15:22
vrurg metabind: p6? 15:25
metabind evalbot usage 15:26
15:26 Doc_Holliwood joined
vrurg Ah! Ok. Dunno, I don't use evalbot. 15:27
[Coke] dd is the rakudo data dumper.
p6: say 'does this do more than moar?'
camelia does this do more than moar?
[Coke] I think p6: defaults to moar, and m: specifically means moar.
vrurg++
vrurg: thought it might exist, but didn't see it when I search for ^mro in the docs. :) 15:28
nine p
vrurg [Coke]: because it's my recent addition with roles overhaul. 15:29
metabind I take it that a lot is still missing from the docs
[Coke] I would say that a lot is NOT missing from the docs.
metabind anything missing is a lot as far as I'm concerned 15:30
being new
15:31 aluaces left
metabind p6: dd Str.^mro 15:32
camelia (Str, Cool, Any, Mu)
metabind p6: dd Str.^mro: :roles 15:33
camelia Cannot find method 'raku' on 'Stringy': no method cache and no .^find_method
in block <unit> at <tmp> line 1
metabind m: dd Str.^mro: :roles
camelia Cannot find method 'raku' on 'Stringy': no method cache and no .^find_method
in block <unit> at <tmp> line 1
15:34 molaf left
[Coke] metabind: That probably needs a ticket. 15:38
metabind: in the meantime, if you find anything is missing, please open a ticket, thanks.
metabind I don't have a github account yet. 15:39
15:47 ufobat joined 16:04 hacktor joined 16:10 xinming left 16:16 xinming joined, Kaiepi left 16:17 Kaiepi joined
moritz no time like now to get one :-) 16:23
16:33 mowcat joined
metabind okay so, Coke taught me that isNaN *should be* included in the Int documentation but isn't so I need to file a bug, and that dd the rakudo dumper function that helps output things that put/say can/will not, and that .^mro: :roles is a recent addition to the language, great stuff thanks 16:34
\leave
i'm very new to all this
16:34 metabind left 16:36 jmerelo joined 16:43 leont left 16:45 sena_kun left 16:47 Doc_Holliwood left 16:50 domidumont left 16:51 domidumont joined
[Coke] \o/ 16:55
16:58 scimon left 16:59 zakharyas left 17:00 sena_kun joined
jmerelo Hey, [Coke] 17:08
tellable6 hey jmerelo, you have a message: gist.github.com/ac4b35c9dd11630d21...e0077cf88f
jmerelo .tell uzl[m] great, thanks!
tellable6 jmerelo, I'll pass your message to uzl[m]
17:12 xinming left, xinming joined 17:14 leont joined
sarna m: [0.0e xx 3] 17:15
camelia 5===SORRY!5=== Error while compiling <tmp>
Confused
at <tmp>:1
------> 3[0.0e7⏏5 xx 3]
sarna I like that error message :^)
jmerelo m: say 3e 17:18
camelia 5===SORRY!5=== Error while compiling <tmp>
Confused
at <tmp>:1
------> 3say 37⏏5e
jmerelo sarna: well, e is a constant
m: say 3+e
camelia 5.718281828459045
jmerelo sarna: but also exponential
m: say 3e2 + e 17:19
camelia 302.71828182845906
jmerelo m: say 1e
camelia 5===SORRY!5=== Error while compiling <tmp>
Confused
at <tmp>:1
------> 3say 17⏏5e
jmerelo sarna: confused is about right. Probably it should be a bit more explicit.
sarna jmerelo: yeah, it wasn’t sarcastic - while it could be more informative, I actually kind of like it 17:23
at least shows you where it is, and it’s right about it :)
a nice refresher after programming in go for a while 17:24
jmerelo sarna :-) 17:25
17:33 Cabanossi joined 17:58 leont left 17:59 wildtrees joined 18:00 wildtrees left 18:01 wildtrees joined 18:02 Sgeo__ left, Sgeo__ joined 18:03 mahmudov joined 18:08 aluaces joined 18:14 MasterDuke joined
jmerelo Apparently there's no gRPC module for Raku... 18:31
... or protobuf 18:33
18:35 leont joined
guifa assigns gPRC to jmerelo 18:38
jmerelo creates a GSoC project for doing that
guifa doesn’t sign up for it O:-)
jmerelo guifa: we need you as a mentor anyway 18:39
guifa: we need lots of them
guifa jmerelo: fair, but this is my last year I can do it as a student
jmerelo guifa: well, it would be great to have you as a student, but you could propose also a project you'd feel comfortable with 18:42
18:42 mahmudov left
jmerelo guifa: we can look for mentors later 18:42
guifa Oh, module naming question 18:44
For format parsing 18:45
18:45 mahmudov joined
guifa should we go with Grammar::Name-of-format or Grammar::Foo::Name-of-format and leave the upper level for Grammar::Extension-modifying-grammars-themselves ? 18:45
or is there a different place we should do that? 18:46
jmerelo guifa: he
guifa (like Parsers::Name-of-format or something like that)
jmerelo guifa: Grammar::Extension::Self-Modifying
18:46 sena_kun left
guifa Ah that actually sounds like a good one for extensions. Should there also be an intermediate one for grammars or keep them top level? (I’m about to post grammars for Hunspell/Aspell/Nuspell/MySpell dictionaries) 18:47
18:49 domidumont left
jmerelo guifa: it's pretty much free. There're no guidelines, even. Choose what's helpful to find it. For instance, Grammar::Dictionary::Hunspell 18:49
18:50 domidumont joined
guifa Yeah, I know there’s no official guidelines, but I feel like since we’re all so early in the ecosystem development, it would be a good idea to have a sort of best practices for naming. Because it would be annoying to have one grammar in Grammar::Dictionary::Hunspell, another one in Lingua::Spelling::MySpell another one in Nuspell (top level) and another one in Text::Spellchecking::Aspell 18:51
jmerelo guifa: but I see Lingua::Spelling as more of a module to use that specific tool, not as a dictionary
guifa: also, that can't be helped. 18:52
18:54 domidumont left
guifa jmerelo: I would agree that I’d expect some of those to be a tool, but for developers of them, there’d be no harm in specifying their grammars that could be general use in a more generalized location and pulling from it instead. I also just don’t have time to develop a full [Hun|A|My|Nu]spell engine right now but have the grammar for another project 18:56
18:57 leont left 19:02 sena_kun joined 19:22 mowcat left 19:28 vrurg left 19:43 Kaiepi left 19:44 Kaiepi joined
TreyHarris From docs.raku.org/language/numerics#Allomorphs : "Keep in mind that allomorphs are simply subclasses of the two (or three) types they represent." '(or three)'? What's a three-type allomorph? 19:48
19:48 xinming left, Doc_Holliwood joined 19:49 xinming joined, patrickb left 19:53 dansolo42 joined
jmerelo TreyHarris: that's a tough one. 19:53
19:54 vrurg joined
jmerelo TreyHarris: but I guess that the allomorph XY represents XY, X and Y, right? 19:54
TreyHarris: well, Y is always Str 19:55
19:55 ensamvarg left
TreyHarris jmerelo: oh, no, I think it's just a historical artifact of MidRatStr 19:58
I think "(or three)" can safely be removed
jmerelo TreyHarris: will you do the honor? You want me to do it? 19:59
TreyHarris jmerelo: already on it
jmerelo TreyHarris: thanks.
20:00 jmerelo left
Geth doc: 42ab3dfefc | (Trey Harris)++ | doc/Language/numerics.pod6
Remove detritus from MidRatStr reference

When allomorphs were first documented in dcd83b, `MidRatStr` still existed as a three-superclass allomorph. That's no longer the case, so remove language referring to hypothetical three-class allomorphs.
But leave open the possibility so this passage isn't brittle against future allomorphs.
20:08
linkable6 Link: docs.raku.org/language/numerics
doc: 26b1a19ca4 | (Trey Harris)++ | doc/Language/numerics.pod6
Wrap numerics "Coercion of allomorphs"

Separate commit to keep semantics & formatting changes separate.
cpan-raku New module released to CPAN! Date::Calendar::Hebrew (0.0.3) by 03JFORGET
20:18 lucasb left
TreyHarris m: say so "12" ~~ 12 20:26
camelia True
TreyHarris how can you do ↑ with Numeric or Int rather than specifying the value 12? 20:27
IOW, how can I check a Str (or other concrete value) to see if it can successfully coerce into some specified type? 20:29
20:29 chloekek joined
guifa hmm, there’s a few different ways depending on your ultimately goal 20:31
Does it have a coercion method?
TreyHarris m: my $x = "12"; say $x.^name; say "{$x + 2}" 20:32
camelia Str
14
guifa my $a = "A"; say $a.^find_method("Int”) // False; say $a.^find_method(“CantCoerceToThis”) // False
err
m: my $a = "A"; say $a.^find_method("Int”) // False; say $a.^find_method(“CantCoerceToThis”) // False 20:33
camelia 5===SORRY!5=== Error while compiling <tmp>
Unable to parse expression in double quotes; couldn't find final '"' (corresponding starter was at line 1)
at <tmp>:1
------> 3find_method(“CantCoerceToThis”) // False7⏏5<EOL>
expect…
guifa *sigh* stupid computer autocoverting quotes
m: my $a = "A"; say $a.^find_method("Foo") // False; say $a.^find_method("CantCoerceToThis") // False;
camelia False
False
guifa m: my $a = "A"; say $a.^find_method("Int") // False; say $a.^find_method("CantCoerceToThis") // False;
camelia Int
False
20:33 heth left, vike left
guifa TreyHarris: see the last one I posted there, if the $foo.^find_method(nameOfClass) returns a defined object, you can theoretically coerce 20:34
TreyHarris m: say "12".^find_method("Numeric")
camelia Numeric
20:34 heth joined
guifa But just because a coercion method exists doesn’t mean you actually will be able to coerce. The only way to test for that is to actually run the coercion 20:34
TreyHarris m: say "boo this is not a number".^find_method("Numeric") 20:35
camelia Numeric
20:35 vike joined
TreyHarris guifa: yes, but: 20:35
m: say so "12" ~~ 12; say so say so "12" ~~ Any(Numeric)
camelia True
False
True
20:36
TreyHarris er
m: say so "12" ~~ 12; say so "12" ~~ Any(Numeric)
camelia True
False
TreyHarris if I don't know the value I'll end up with, how do I do it?
catch an exception?
guifa Probably the easiest way to do it. If you wanted to, you could possibly write a sub for it. Lemme see what I can come up with real fast 20:37
MasterDuke val perhaps would be useful 20:39
val()
20:45 sena_kun left 20:50 wildtrees left
TreyHarris odd: 20:51
m: sub get-num($x) { CATCH { when X::Str::Numeric { .^name.say; .message.say } }; return $x.Numeric }; for ("12", "\c[FULLWIDTH DIGIT ONE,FULLWIDTH DIGIT TWO]") -> $n { say get-num($n) }
camelia 12
12
TreyHarris but
m: sub get-num($x) { CATCH { when X::Str::Numeric { .^name.say; .message.say } }; return $x.Numeric }; for ("12", "\c[FULLWIDTH DIGIT ONE,FULLWIDTH DIGIT TWO]", "\c[ROMAN NUMERAL TWELVE]") -> $n { say get-num($n) } 20:52
camelia 12
Cannot convert string to number: base-10 number must begin with valid digits or '.' in '3⏏5Ⅻ' (indicated by ⏏)
in sub get-num at <tmp> line 1
in block <unit> at <tmp> line 1

12
TreyHarris Why doesn't the second one work there
21:00 Benett left, Benett joined 21:01 sena_kun joined 21:15 aborazmeh joined, aborazmeh left, aborazmeh joined 21:33 mensvaga left
tyil samcv: home.tyil.nl/git/raku/Pod::To::Anything/about/ this is the base module I use for Pod6 stuff 21:40
samcv: this is the thing used for rendering Pod6 readmes on my cgit instance home.tyil.nl/git/raku/Pod::To::HTM...ion/about/ 21:46
21:48 rindolf left 21:58 aborazmeh left, Ven`` joined
Ven`` jnthn: as it turns out, adding default params to cro template is *really* easy, but that would be absolute hell in the JS backend :P. 21:59
22:02 Ven`` is now known as Ven_de_Thiel 22:05 cpan-raku left
jnthn Ven_de_Thiel: Even if restricted only to nameds? 22:08
22:10 cpan-raku joined, cpan-raku left, cpan-raku joined
Ven_de_Thiel jnthn: I mean, grammar-wise 22:11
jnthn Yes, but I thought the nameds in the JS compilation were done by forming a "hash"? 22:12
Ven_de_Thiel yes, but JS doesn§t have default parameters
so when we `make $/` after parsing `<.identifier> [ '=' <.expression> ]?` 22:13
JS doesn't like it
I guess recent javascript version (ES6+) actually has defaults, so maybe it's fine... 22:14
22:16 Black_Ribbon joined 22:21 chloekek left
rypervenche How might I use Raku to open an image (say a jpg) for viewing? Would that require a module? 22:21
Grinnz the linux only solution would be to run xdg-open on the filename 22:22
22:27 shred_alert left
rypervenche Ah, is that how people would do it? 22:27
22:45 sena_kun left 22:54 sauvin_ joined 22:57 sauvin left, sauvin_ is now known as Sauvin
El_Che write a small lib that checks the OS and open xdg-open/open/start accordingly? 22:57
23:00 sena_kun joined 23:03 aluaces left 23:08 wildtrees joined
uzl[m] .tell sarna Still trying to figure out how to make the grid layout work for smaller screen size. Pretty much a CSS noob ;-). 23:12
tellable6 uzl[m], I'll pass your message to sarna
23:14 wamba joined
uzl[m] .tell [Coke] re layout/css: Do you have any color scheme in mind? I myself find it too pale. 23:15
tellable6 uzl[m], I'll pass your message to [Coke]
23:46 mowcat joined