🦋 Welcome to Raku! raku.org/ | evalbot usage: 'p6: say 3;' or /msg camelia p6: ... | irclog: colabti.org/irclogger/irclogger_log/raku Set by ChanServ on 14 October 2019. |
|||
00:30
Tirifto left
00:34
rindolf left
00:44
pecastro left
|
|||
tony-o | .tell guifa sql::slang might fit your definition of "integrated into the language" | 01:34 | |
tellable6 | tony-o, I'll pass your message to guifa2 | ||
01:42
wamba joined
02:41
jmchael left
03:06
Manifest0 left,
Manifest0 joined
|
|||
xinming | SmokeMachine: when we use infix<in>, the RHS is an empty array, This will cause Red to generate sql which is like xxxx IN ( ) Which results an error, What is the sensible behavior in this case do you think please? | 03:37 | |
Or we should raise error too just like postgres does? | 03:38 | ||
03:39
xelxebar left
|
|||
xinming | I'll write a patch which raise error just like postgres does. | 03:39 | |
03:39
xelxebar joined
04:14
__jrjsmrtn__ joined
04:15
_jrjsmrtn left
04:42
rindolf joined
04:59
thdrmz left
05:00
thdrmz joined
05:04
thdrmz1 joined
05:05
thdrmz left,
thdrmz1 is now known as thdrmz
05:11
thdrmz left,
thdrmz1 joined
05:13
thdrmz1 is now known as thdrmz
05:53
zln_ joined
05:54
zln left
06:02
vivelakira joined
06:05
vivelakira left
06:23
wamba left
06:36
webstrand left
06:44
brtastic joined
07:08
parabolize left
|
|||
xinming | What is the best way to make die on warning? | 07:26 | |
07:40
brtastic left
07:41
brtastic joined
07:58
cog joined
08:02
cog__ left
08:06
brtastic left,
wamba joined
08:21
ranpoom joined
08:33
brtastic joined
09:02
Doc_Holliwood joined
09:04
wamba left
09:15
Altai-man joined
09:28
wamba joined
09:43
leah2 left
|
|||
CIAvash | xinming: colabti.org/irclogger/irclogger_lo...10-29#l150 ? | 09:52 | |
09:57
leah2 joined
10:18
sjm_uk joined
|
|||
Geth | doc: 6343e91df0 | (JJ Merelo)++ | doc/Language/variables.pod6 Align and move left |
10:31 | |
doc: 842a581618 | (JJ Merelo)++ | doc/Language/variables.pod6 Avoid wrapping |
|||
linkable6 | Link: docs.raku.org/language/variables | ||
10:41
wamba left
10:43
webstrand joined
10:46
Sgeo left
11:06
pecastro joined
11:16
sjm_uk left
11:53
sjm_uk joined
11:55
aborazmeh joined,
aborazmeh left,
aborazmeh joined
11:57
sena_kun joined
11:58
Altai-man left
12:02
gugod left
12:05
aborazmeh left
12:29
wamba joined
13:16
jmchael joined
13:31
sjm_uk left
|
|||
gfldex | lolibloggedalittle: gfldex.wordpress.com/2020/12/27/as...ctability/ | 13:40 | |
I found myself trying to avoid naming 2020. Good riddance. | 13:41 | ||
14:08
pmurias joined
|
|||
pmurias | timotimo: that mode would keep you from getting distracted by lesser stuff while having important irc conversations? | 14:10 | |
14:17
zln_ left,
xelxebar left,
zln joined,
xelxebar_ joined
14:19
tejr left
14:20
tejr joined
14:21
asymptotically left,
gugod joined
14:24
asymptotically joined
|
|||
xinming | CIAvash: ??? | 14:25 | |
14:31
aborazmeh joined,
aborazmeh left,
aborazmeh joined
14:32
wamba left
|
|||
timotimo | pmurias: probably! | 14:32 | |
14:36
aborazmeh left
14:38
aborazmeh joined,
aborazmeh left,
aborazmeh joined
14:39
parabolize joined
14:43
notagoodidea joined
14:47
aborazmeh left
14:49
aborazmeh joined,
aborazmeh left,
aborazmeh joined
15:05
wamba joined
|
|||
notagoodidea | Hi all! Does Raku expose the GMP binding used in Rakudo/MoarVM? | 15:06 | |
pmurias | Raku has built in big integers | 15:15 | |
15:17
orinthe left
|
|||
notagoodidea | Yes I know, but I looking at the functions for Int/Numeric in the doc, I don't see some usually found in GMP binding. | 15:17 | |
So if the GMP in full binded to provide BigInt in Raku, can we access those binding? For example, in Julia GMP is also used to provide BigInt built-in and offers to expose GMP binding via the standard lib (Base). | 15:19 | ||
15:28
orinthe joined
|
|||
timotimo | we don't use the gnu multiprecision library in moarvm | 15:31 | |
someone is working on a patch to get a fork of gmp in | 15:32 | ||
notagoodidea | Ah that why it was mixed up in my head. | ||
that's* | 15:33 | ||
timotimo | at the moment we have libtommath | ||
gmp is not great to use inside of something like moarvm, it doesn't really offer error handling, instead seems to prefer sending a signal | |||
15:34
aborazmeh left
|
|||
timotimo | i guess that's cool if you have only a single thread? | 15:34 | |
notagoodidea | Yep probably. Never really tried to leverage GMP in multi-threaded environment. I mostly played with the Julia binding when messing with the collatz conjecture for fun. | 15:35 | |
Geth | doc: uzluisf++ created pull request #3752: Document several metamethods |
15:42 | |
notagoodidea | I am just a beginner at Raku in the "What if" & "How I tranlsate what I know" phase so weird questions pops up in my mind. | 15:44 | |
lizmat | notagoodidea: weird questions are ok in my book, as they show out-of-the-box thinking | 15:49 | |
MasterDuke | the moarvm gmp branch builds on linux and passes all tests (and is much faster at bigint math operations), but needs someone who knows (and has access to) windows to get it building there | 15:51 | |
notagoodidea | Does it leverage multi dispatch to provide a full binding to GMP API or can we expect to call directly GMP binding if it is merged? | 15:52 | |
15:56
Altai-man joined
|
|||
notagoodidea | lizmat: Thanks. otb thinking I don't know but we all have a background and concept that we try to hold to when learning something before being able to let it go and embrace a new way to approach topics. | 15:58 | |
15:58
sena_kun left
15:59
domidumont left,
domidumont joined
|
|||
lizmat | multi dispatch only exists at the HLL level | 15:59 | |
notagoodidea | Ah, I have been bitten by a "Numeric overflow", is it an implementation choice (as big int are provided) ? | 16:00 | |
lizmat | the GMP API binding is ultimately exposed as NQP ops in Rakudo | ||
Seeing numeric overflow errors are rare in Raku, afaik :-) | |||
because bigints are the default | 16:01 | ||
notagoodidea | Yeah, I just tried 10**100**100. | ||
timotimo | well, how big is that number? | ||
m: say (10 ** 5) ** 6; say 10 ** (5 ** 6); say 10 ** 5 ** 6 | 16:02 | ||
camelia | 1000000000000000000000000000000 1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000… |
||
16:02
cpan-raku left
|
|||
timotimo | er, yeah | 16:02 | |
MasterDuke | notagoodidea: there are no nqp or rakudo changes, it's all under the hood | ||
timotimo | m: say ((10 ** 5) ** 6).chars; say (10 ** (5 ** 6)).chars; say (10 ** 5 ** 6).chars | ||
camelia | 31 15626 15626 |
||
16:03
cpan-raku joined,
cpan-raku left,
cpan-raku joined
|
|||
timotimo | m: say 100 ** 100 | 16:03 | |
camelia | 100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 | ||
timotimo | m: say (100 ** 100).chars | ||
camelia | 201 | ||
MasterDuke | gmp does allow bigger numbers than libtommath | ||
timotimo | how does that grow | 16:04 | |
10 ** (100 ** 100) is just a number as long as (1 with 201 zeroes) digits? | 16:05 | ||
notagoodidea | timotimo: Add one unt to the second exponent, it add an order of digits in the number. 10*100*1 = 101 digits, 10*100*2 = 1001 digits. | ||
s/unt/unit | |||
timotimo | m: say (100 ** 100).log | ||
camelia | 460.51701859880916 | ||
timotimo | does that mean the number of digits fits into a 460 bit number? | 16:06 | |
aukkras | m: say (100 ** 100).log/2.log | 16:07 | |
camelia | 664.3856189774725 | ||
aukkras | 665 bit number | ||
timotimo | so you were expecting rakudo to do what, exactly? | ||
IBM Physical server Power System E980: 64 TB | 16:08 | ||
how many of those would you need to rent at the same time to store the number? | |||
MasterDuke | m: say (2**10000000000).chars | 16:09 | |
camelia | Numeric overflow in block <unit> at <tmp> line 1 |
||
timotimo | i mean i guess you don't have to store it in ram, you could store it on a few .. kilometers? of magnetic tape | ||
MasterDuke | ^^^ succeeds with gmp | ||
timotimo | i think i'm getting the calculations wrong | 16:10 | |
honestly, it's possible that there's an optimization for 2 ** x for very high x | 16:11 | ||
since that can be satisfied with a single page of memory plus lazily allocating zeroed pages :P | |||
16:12
gordonfish left
|
|||
timotimo | 10 ** x on the other hand, not as easily, unless i guess you also implement BCD? | 16:13 | |
m: say (10 ** 100).base(2) | |||
camelia | 10010010010011010110100100101100101001100001101111100111010110000101100100111100001001100010011001110000010111111001110001010110011100100000010001110001000010001101001111100101010101011001001000011000010001010100000101110100011110001000000000000000000… | 16:14 | |
timotimo | i'm too lazy to look up if there's a closed form for digit index to digit for 10 ** x in log2 | ||
notagoodidea | timotimo: If you want to get the number of digits in an number : ($n).log10 + 1 and floor it if it is decimal. But not sure it was your question/observation. | 16:15 | |
timotimo | ok, how many bits do you need to store the result of 10 ** (100 ** 100)? | 16:16 | |
16:16
gordonfish joined
16:17
zln left
|
|||
raku-bridge | <frost> m:sub f {return 1,'a'}; my ($a,$b); $a,$b = f; say "$a $b"; | 16:21 | |
evalable6 | WARNINGS for /tmp/vq7KT6CDKb: 1 a Useless use … |
||
frost, Full output: gist.github.com/0abc9b0cc661f264f5...d2bd464339 | |||
SmokeMachine | xinming: I thought I’d fixed that... but if it’s an empty array, it should be changed to something that’s always false, like `1 = 0` | ||
raku-bridge | <frost> m:sub f {return 1,'a'}; my ($a,$b); ($a,$b) = f; say "$a $b"; | 16:22 | |
evalable6 | 1 a | ||
MasterDuke | m: sub f {return 1,'a'}; my ($a,$b); $a,$b := f; say "$a $b"; | ||
camelia | WARNINGS for <tmp>: 1 a Useless use of $a in sink context (line 1) Use of uninitialized value element of type Any in string context. Methods .^name, .raku, .gist, or .say can be used to stringify it to something meaningful. in block <unit… |
||
aukkras | m: (100 ** 100 ) * (10.log / 2.log) | 16:23 | |
camelia | WARNINGS for <tmp>: Useless use of "*" in expression "(100 ** 100 ) * (10.log / 2.log)" in sink context (line 1) |
||
16:23
cetjs2 joined
|
|||
cetjs2 | hello | 16:23 | |
aukkras | m: say (100 ** 100) * (10.log / 2.log); | 16:24 | |
camelia | 3.3219280948873626e+200 | ||
cetjs2 | What is Web Frameworks for raku? what is popular qnd laravel-like? | ||
raku-bridge | <frost> Cro? | 16:25 | |
cetjs2 | what is cro? | 16:26 | |
lizmat | cro.services | ||
SmokeMachine | cetjs2: I think it’s cro | ||
16:28
Tirifto joined
|
|||
SmokeMachine | cetjs2: are you going to use db? | 16:29 | |
Geth | doc: 5e1260bcbb | (Luis F. Uceta)++ (committed by Juan Julián Merelo Guervós) | doc/Type/Metamodel/PrivateMethodContainer.pod6 Document several metamethods |
||
linkable6 | Link: docs.raku.org/type/Metamodel::Priv...dContainer | ||
notagoodidea | Ah. Would take the products of the log2, no? But trying with 10**10**3 give Inf whith log2. | ||
m: (10**10**3).log2 | |||
camelia | ( no output ) | ||
notagoodidea | m: (10**10**3).log2.say | ||
camelia | Inf | ||
SmokeMachine | cetjs2: you can also take a look on Red if you want a ORM... | 16:30 | |
cetjs2 | SmokeMachine, I think using sqlite3... who is red orm? this like hibernate or elegant orm? | 16:33 | |
SmokeMachine | cetjs2: it’s more Raku ish... and it works with SQLite too... memory and file... | 16:35 | |
modules.raku.org/dist/Red:cpan:FCO | |||
cetjs2: ^^ | |||
cetjs2: fco.github.io/Red/ | 16:40 | ||
16:40
guifa2 joined
|
|||
guifa2 | o/ | 16:40 | |
tellable6 | 2020-12-27T01:34:07Z #raku <tony-o> guifa sql::slang might fit your definition of "integrated into the language" | ||
guifa2 | tony-o absolutely! Dunno how I forgot about that one | ||
SmokeMachine | guifa2: I would also say Red is “integrated into the language”... | 16:41 | |
guifa2 | SmokeMachine: that was already in my list of modules to show off ;-) | 16:42 | |
SmokeMachine | guifa2: :) | ||
notagoodidea | m: say 1 + (100**100) * 10.log10 | 16:43 | |
camelia | 1e+200 | ||
notagoodidea | m: say (1 + (100**100) * 10.log10).base(2).chars | 16:44 | |
camelia | 665 | ||
notagoodidea | timotimo: 665 bits for 10**100**100, it seems low no? | 16:45 | |
timotimo | yeah | ||
aha | 16:46 | ||
wolframalpha to the rescue | |||
guifa2 | Hmm, what might the best way to split a string when you want to capture a combining grapheme? | ||
combining character* | 16:47 | ||
timotimo | the resulting number has 100 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 001 decimal digits | ||
guifa2 | ah, probably $foo.Uni.split | 16:48 | |
notagoodidea | m: say (1 + (100**100) * 10.log10).chars | ||
camelia | 6 | ||
notagoodidea | timotimo: So the 1 + $exposant * base.log10 is correct. | 16:49 | |
But I converted the number of digits in bits, that's why is so low -_- | 16:50 | ||
timotimo | right | ||
so, moar is perhaps justified in calling that an overflow | |||
notagoodidea | m: say (1 + (100**100) * 10.log2).floor | 16:51 | |
camelia | 332192809488736258156007321626732964933652037630384773984828053001819499610649784180077247442368308425414021275635919348520235492085887256739957544934325558774604993429445235567958526664961728068976640 | ||
notagoodidea | Hahaha yep, it seems that would a correct estimate of the number of bits needed. | 16:52 | |
timotimo: So the next question si what is the limit? Is it a hard limit from MoarVM or libtommath or machine-dependant? | 16:53 | ||
timotimo | may very well be a hard limit in moar itself | 16:56 | |
notagoodidea | But what surprise me too, is that the taking the log from (10**10**3) raises Inf. Does Numeric does not drop to FatRat? | 17:00 | |
m: say (10**10**3).log2.^name | 17:01 | ||
camelia | Num | ||
notagoodidea | ok, I am lost in the type hierarchy of Raku now. :) | 17:02 | |
lizmat | TimToady decided it would fallback to Num, as the performance of FatRat degrades pretty quickly and pretty bad | ||
if you want FatRats, you need to start with FatRats | 17:03 | ||
notagoodidea | Ok and Num is bounded by 64 bits float if I understand correctly from the doc? | 17:04 | |
lizmat | yup, afaik :-) | ||
notagoodidea | lizmat: Um. even with FatRat, log2 returns Inf. `my $num = FatRat.new(10**10**3, 1); $num.log2` => Inf and $num.^name => FatRat. | 17:08 | |
lizmat | hmmm... perhaps .log2 always returns a num because the underlying math lib doesn't know about Rats ? | ||
guifa2 | the problem is the log function; I think, which isn't designed to work with Rats (because of the iunerling | ||
^^ | |||
notagoodidea | Because log2 is supplied by the Numeric role and so its bounded by the Numeric restriction? | ||
lizmat | no, it's a limitation of the underlying math lib, I'd say | 17:09 | |
aukkras | m: say (10**10**3) | 17:11 | |
camelia | 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000… | ||
notagoodidea | hum ok. I am not sure to have a clear model between class and role (Num vs Numeric in this case) yet. | 17:12 | |
guifa2 | Numeric is the numbers equivalent of Stringy | 17:13 | |
Numeric just describes something that can function as a number-like thing | |||
notagoodidea | lizmat: Ok, probably. Julia seems to handle it without trouble (it is GMP backed). | 17:14 | |
guifa2: And Num describe what number is? | 17:15 | ||
lizmat | notagoodidea: not sure what Raku isn't handling properly wrt to Julia ? | ||
guifa2 | Num is just a specific representation (that is backed internally by a floating point number) | ||
notagoodidea | lizmat: Throwing the Inf for the log2(10**10**3), sorry. | ||
So not Raku per se but the undrelying libs for big int. | 17:16 | ||
lizmat | I seem to recall that's a deficiency of libtommath | ||
notagoodidea | guifa2: thanks, it is a bit clearer :) | ||
17:16
ranpoom left
|
|||
lizmat | that gmp doesn't have, and one of the reasons for trying to migrate to it | 17:16 | |
guifa2 | Theoretically, you could make a Hyperreal class, define it as Numeric, and it would play well with math functions. No idea how you'd encode it internally though hahaha | 17:17 | |
But the idea is that all number operations shoudl return something that's Numeric. So Int / Int doesn't get you Int, but a Rat. But most of the time, it's not important | 17:18 | ||
(the idea being that people who do care about the difference know how to deal with it normally, and those who don't, don't have to worry about it) | |||
guifa2 . o O ( unfortunately, while most folks knokw to use Numeric to accept all numbers, they're not as good about using Dateish or Stringy, although with the new coercion mechanics — vrurg++ — that might not be a huge issue anymore) | 17:24 | ||
notagoodidea | guifa2: Yep, the underlying logic is clear now, at least until nex time it will bite me :D | 17:25 | |
18:15
jmerelo joined
|
|||
jmerelo | .tell El_Che very interesting talk by Carmen Andoh... | 18:17 | |
tellable6 | jmerelo, I'll pass your message to El_Che | ||
guifa2 waves at jmerelo | 18:21 | ||
did you see my FOSDEM proposal? | |||
jmerelo | guifa2: yep I did. Already graded it; however, last time I checked only grades were by me, so I'm waiting for someone else to check them out before we send out notices. | 18:22 | |
tellable6 | 2020-12-23T19:47:14Z #raku <guifa2> jmerelo when you get a chance, I'm finishing up my FOSDEM proposal, have a few Qs | ||
guifa2 | ^^lol @ tellable | 18:23 | |
18:23
domidumont left
18:27
mowcat joined,
wamba left,
jmerelo left
18:28
jmerelo joined
|
|||
jmerelo | Not sure my last message got in | 18:28 | |
Lights went out for a few seconds | |||
guifa2: I see it got through. Still have some questions? | 18:34 | ||
18:35
cetjs2 left
|
|||
guifa2 | jmerelo: nope, just checking that it got in on time ^_^ | 18:40 | |
18:41
pmurias left
18:48
aluaces left
18:50
aluaces joined
19:01
notagoodidea left
19:20
thundergnat joined
|
|||
El_Che | jmerelo: the goconf talk? Yes, it was surprisingly interesting and applicable to Raku | 19:23 | |
tellable6 | 2020-12-27T18:17:43Z #raku <jmerelo> El_Che very interesting talk by Carmen Andoh... | ||
19:26
b2gills left
19:35
notagoodidea joined
19:40
Sgeo joined
19:43
oboe joined
|
|||
oboe | merry festivus all! can someone help me with stopping automatic type coercion? | 19:44 | |
i have a simple sub which takes an integer, but if instead the command line looks like --option rather than --option=number, then a boolean is created, which is auto coerce to true and then 1, which I was not anticipating! | 19:46 | ||
El_Che | are you typing the variables? | ||
oboe | i can do subset Integer of Int where (IntStr) and then sub MAIN(Integer :$option = 0) {...} but surely there is an easier way? | 19:47 | |
19:48
jmerelo left
|
|||
oboe | i had assumed that sub MAIN(Int :$option) would suffice! | 19:49 | |
moritz | wait what? which part isn't enough? | 19:50 | |
if you want 0 as the default, you need to make that explicit | |||
timotimo | Bool is Int in raku | ||
oboe | sub MAIN(Int :$option) is letting in booleans! | ||
moritz | sub MAIN(Int :$option = 0) { } | ||
oboe | I only want integers! | ||
moritz | m: say Bool ~~ Int | 19:51 | |
camelia | True | ||
MasterDuke | btw, why wouldn't you just do `sub MAIN(IntStr :$option = 0) {...}`? why the subset? | ||
oboe | to get rid of booleans. The integer command-line argument is shortening strings and the boolean option is shortening them by 1 which I wasn't expecting to pass type checking | 19:52 | |
as I wasn't expecting booleans to be let through | 19:53 | ||
timotimo | m: @*ARGS = <--foo True>; multi sub MAIN(Int :$foo where none(Bool)) { say "yay" } | ||
camelia | Usage: <tmp> [--foo=<Int where { ... }>] |
||
timotimo | m: @*ARGS = <--foo True>; multi sub MAIN(Int :$foo) { say "yay" } | ||
camelia | Usage: <tmp> [--foo=<Int>] |
||
timotimo | ok that's not how | 19:54 | |
m: @*ARGS = <--foo=True>; multi sub MAIN(Int :$foo) { say "yay" } | |||
camelia | yay | ||
19:54
rindolf left
|
|||
timotimo | m: @*ARGS = <--foo=True>; multi sub MAIN(Int :$foo where none(Bool)) { say "yay" } | 19:54 | |
camelia | Usage: <tmp> [--foo=<Int where { ... }>] |
||
timotimo | here it rejects the boolean | ||
oboe | Thanks timotimo! | ||
That reads way better | |||
timotimo | you'll want to change the outut from the usage and hel though, since "where { ... }" looks weird | 19:55 | |
19:55
b2gills joined
19:57
sena_kun joined
|
|||
oboe | Yes, I had found that range checking and auto usage generation are less that awesome | 19:58 | |
19:59
Altai-man left
|
|||
oboe | timotimo: your solution seems to still let booleans in! | 20:02 | |
sub MAIN( Int :$trim-trailing where { none (Bool) } = 0) { say 'trim-trailing: ' ~ $trim-trailing.^name ~ ': ' ~ $trim-trailing.Numeric ~ ': ' ~ $trim-trailing; } | |||
evalable6 | trim-trailing: Int: 0: 0 | ||
oboe | if I run it with: raku test.raku --trim-trailing | 20:04 | |
i still get:trim-trailing: Bool: 1: True | |||
timotimo | dang | ||
20:07
grep0r left
|
|||
MasterDuke | m: @*ARGS = <trim-trailing>; sub MAIN( Int :$trim-trailing where { .^mro[0] !=== Bool } = 0) { say "trim-trailing: " ~ $trim-trailing.^name ~ ": " ~ $trim-trailing.Numeric ~ ": " ~ $trim-trailing; } | 20:09 | |
camelia | Usage: <tmp> [--trim-trailing=<Int where { ... }>] |
||
MasterDuke | m: @*ARGS = <--trim-trailing>; sub MAIN( Int :$trim-trailing where { .^mro[0] !=== Bool } = 0) { say "trim-trailing: " ~ $trim-trailing.^name ~ ": " ~ $trim-trailing.Numeric ~ ": " ~ $trim-trailing; } | ||
camelia | Usage: <tmp> [--trim-trailing=<Int where { ... }>] |
||
MasterDuke | m: @*ARGS = <--trim-trailing=3>; sub MAIN( Int :$trim-trailing where { .^mro[0] !=== Bool } = 0) { say "trim-trailing: " ~ $trim-trailing.^name ~ ": " ~ $trim-trailing.Numeric ~ ": " ~ $trim-trailing; } | 20:10 | |
camelia | trim-trailing: IntStr: 3: 3 | ||
MasterDuke | oboe: does ^^^ work for what you want? | ||
oboe | MasterDuke: checking... | 20:11 | |
That works MasterDuke. It still seems an aweful mouthful for just specify Int only. | 20:12 | ||
subset Integer of Int where (IntStr) | 20:13 | ||
is also obtuse | |||
MasterDuke | true. but that's kind of how inheritance works, right? Bool is an Int. You're asking for an Int and you're getting one, you just happen to not like its flavor | 20:14 | |
have you looked at GetOpt::Long? the builtin CLI argument handling has some limitations (i don't remember why), but if you're willing to use a module it can do more | 20:16 | ||
oboe | Thanks MasterDuke. I really like the builtin stuff. It seems so close to perfect! | 20:17 | |
I last used GetOpt::Long with perl5. | |||
I take it mro is for method resolution order? | |||
MasterDuke | i believe the raku version is pretty similar, but i personally haven't looked at the details in a long time | ||
gfldex | m: @*ARGS = <--trim-trailing=3>; sub MAIN( Int() :$trim-trailing ) { dd $trim-trailing } | 20:18 | |
camelia | IntStr.new(3, "3") | ||
MasterDuke | yea. the ^ signifies it's a meta-method, i.e., operating on the objects metaclass | ||
gfldex | oboe: you didn't asked Rakudo for coercion. You just asked for a type check. | ||
20:19
wamba joined
|
|||
oboe | yep, i was asking for type check and seeing what i thought was auto type coercion under the radar | 20:20 | |
which was subverting the type checking | 20:22 | ||
I was expecting the following to fail type checking: | 20:25 | ||
m: sub MAIN( Int() :$trim-trailing = 0) { say dd $trim-trailing; } | 20:26 | ||
camelia | 0 Nil |
||
oboe | m: @*ARGS = <--trim-trailing>; sub MAIN( Int() :$trim-trailing = 0) { say dd $trim-trailing; } | ||
camelia | Bool::True Nil |
||
20:28
aluaces left
20:29
aluaces joined
|
|||
oboe | Aside: What is the offline way to access docs? perldoc seems fubar. | 20:31 | |
I'm reduced to: raku --doc /usr/local/Cellar/rakudo-star/2020.10/share/perl6/site/doc/*.pod6 | 20:32 | ||
MasterDuke | rakudoc is the successor to p6doc, but i'm not quite sure its status | 20:34 | |
oboe | There is an equivalence between sum and [+]. Is there another for [*]? | ||
MasterDuke | nope | ||
oboe | okay. no rakudoc. is that a zef install. i'm with rakudo-star. | 20:35 | |
MasterDuke | believe so | 20:36 | |
20:38
leont joined
20:51
brtastic left
20:55
defaultxr left
21:13
oboe left
21:18
Doc_Holliwood left
21:22
sena_kun left
21:23
_hxearth\` joined,
_hxearth\` left
21:29
wamba left
21:45
wamba joined
21:48
wamba left
21:54
jmchael left
|
|||
guifa2 | what's the best way to approach compiling modules when they have enough files that it occasionally dings the open file limit? | 21:55 | |
timotimo | get the lazy devs to hunt down the leaking file descriptors | 21:56 | |
guifa2 | timotimo: I'm the developer :-) | ||
I was just using zef install . to test installing | 21:57 | ||
22:04
sxmx left
22:05
jmchael joined
22:06
sxmx joined
22:08
guifa2 left
22:40
jferrero left
|
|||
El_Che | if only the dev will hit it, raise your ulimit? | 22:59 | |
23:01
wamba joined
23:05
xelxebar_ left,
xelxebar joined
23:11
wamba left
23:18
rypervenche left
23:41
rypervenche joined
23:48
leont left
23:57
jmchael left
|