🦋 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: ... | Logs can be inspected at colabti.org/irclogger/irclogger_log/raku
Set by lizmat on 1 May 2021.
QhpAptyj9hj0RQwM Hey, I'm having trouble with specifying a user-defined character class that includes a predefined character class with no shorthand(alpha). Is there a way to do this? 14:27
MasterDuke QhpAptyj9hj0RQwM: i believe the only way to do that (if i'm thinking of the right thing) is with EVAL 14:44
tonyo QhpAptyj9hj0RQwM: ean example? 14:56
QhpAptyj9hj0RQwM MasterDuke: Thanks, I'll look into this. 15:01
tonyo: Something like $string ~~ / <[ <alpha> @ ]> /; 15:04
This one won't work though, because < is interpreted as a literal. 15:05
Geth doc: f15f479f97 | (JJ Merelo)++ | doc/Type/Junction.pod6
Minor change mainly to trigger tests
15:16
linkable6 Link: docs.raku.org/type/Junction
jmerelo releasable6:status 15:17
releasable6 jmerelo, Next release in ≈4 days and ≈3 hours. There are no known blockers. 0 out of 34 commits logged
jmerelo, Details: gist.github.com/4c6a74a9188eee9920...d2c4c02282
tonyo QhpAptyj9hj0RQwM: what's wrong with $str ~~ / (<alpha>|'@')+ / ? 15:30
QhpAptyj9hj0RQwM tonyo: Nothing, but it doesn't feel elegant UwU 15:53
ugexe / <+alpha +[@]> /; 15:58
tonyo QhpAptyj9hj0RQwM: try <+alpha+['@']>
QhpAptyj9hj0RQwM Thank you, senpai. 16:11
lizmat and yet another Rakudo Weekly News hits the Net: rakudoweekly.blog/2021/05/17/2021-...nodelayed/ 16:57
Juerd :) 16:59
lizmat afk for a bit& 17:00
Doc_Holliwood what's the conditional method call operator again? 17:22
codesect` .?
Doc_Holliwood m: my $x; say $x.?sum 17:25
camelia Cannot resolve caller sum(Any:U: ); none of these signatures match:
(Any:D: *%_)
in block <unit> at <tmp> line 1
Doc_Holliwood m: my $x; say $x.//sum
camelia 5===SORRY!5=== Error while compiling <tmp>
Malformed postfix call
at <tmp>:1
------> 3my $x; say $x.7⏏5//sum
Doc_Holliwood m: my $x; say $x//.sum
camelia Cannot resolve caller sum(Any:U: ); none of these signatures match:
(Any:D: *%_)
in block <unit> at <tmp> line 1
Doc_Holliwood m: my $x; say $x and $x.sum or 0 17:26
camelia WARNINGS for <tmp>:
(Any)
Useless use of constant integer 0 in sink context (line 1)
Cannot resolve caller sum(Any:U: ); none of these signatures match:
(Any:D: *%_)
in block <unit> at <tmp> line 1
jmerelo m: my $x=3; say $x.?sum
camelia 3
Doc_Holliwood m: my $x; say ($x and $x.sum) or 0 17:27
camelia WARNINGS for <tmp>:
(Any)
Useless use of constant integer 0 in sink context (line 1)
codesect` oh, I misunderstood -- .? is conditional in the way JJ just showed, but not in the way you're looking for
m: my $x; say try $x.sum; # the only way I know 17:28
camelia Nil
Doc_Holliwood m: my $x; say try $x.sum || 0
camelia Nil
Doc_Holliwood m: my $x; say { try $x.sum } || 0
camelia -> ;; $_? is raw = OUTER::<$_> { #`(Block|52197816) ... }
Doc_Holliwood m: my $x; say { try $x.sum }->() || 0
camelia 5===SORRY!5=== Error while compiling <tmp>
Unsupported use of ->(), ->{} or ->[] as postfix dereferencer. In Raku
please use: .(), .[] or .{} to deref, or whitespace to delimit a pointy
block.
at <tmp>:1
------> 3my $x; say { try $x.su…
Doc_Holliwood m: my $x; say { try $x.sum }() || 0 17:29
camelia 0
codesect` m: my $x; say (try $x.sum) || 0
camelia 0
codesect` m: my $x; say (try $x.sum) // 0 # actually, 17:29
camelia 0
Doc_Holliwood i don't know 17:32
guess i will stick with a ternary then 17:33
codesect` hmm? I thought ^^^^ was what you wanted?
jmerelo Actually, not very clear to me what's the use case here. 17:34
Shouldn't it avoid raising an exception? If it raises an exception if it does not exist, then what's the different WRT just calling it directly?
Ah, OK. You need to check against Nil docs.raku.org/language/operators#i...hodop_.%3F 17:35
jmerelo m: my $x; say $x.?sum // "Nope" 17:36
camelia Cannot resolve caller sum(Any:U: ); none of these signatures match:
(Any:D: *%_)
in block <unit> at <tmp> line 1
jmerelo m: my $x; say $x.?sum() // "Nope"
camelia Cannot resolve caller sum(Any:U: ); none of these signatures match:
(Any:D: *%_)
in block <unit> at <tmp> line 1
Doc_Holliwood gist.github.com/holli-holzer/8a69c...2c8785026e
codesect` yeah, the version I showed with the parens works there 17:38
m: my $x; say (try $x.sum) // 0
camelia 0
jmerelo Doc_Holliwood: right. But the thing above should work, right? It's checking for definedness
Hum 17:39
Doc_Holliwood yes, but it's obscure and introduces another set of braces
jmerelo I think that the problem is that $x is not defined.
Doc_Holliwood i hate braces =)
jmerelo m: my $x = "Can't"; say $x.?sum() // "Nope" 17:40
camelia Cannot convert string to number: base-10 number must begin with valid digits or '.' in '3⏏5Can't' (indicated by ⏏)
in block <unit> at <tmp> line 1
jmerelo m: my $x = 0|1; say $x.?sum() // "Nope"
camelia any(0, 1)
jmerelo m: my $x = :3foo; say $x.?sum() // "Nope" 17:41
camelia Cannot resolve caller Numeric(Pair:D: ); none of these signatures match:
(Mu:U \v: *%_)
in block <unit> at <tmp> line 1
jmerelo I think it does not work very well on a multi 17:42
m: my $x = :3foo; say $x.?foo() // "Nope" 17:43
camelia Nope
codesect` how about:
Doc_Holliwood m: my $x; say (.item with $x.?x) || 0
camelia 0
codesect` m: my $x; say $x.?&sum//0 17:44
camelia Cannot resolve caller sum(Any:U: ); none of these signatures match:
(Any:D: *%_)
in block <unit> at <tmp> line 1
jmerelo m: my $x; say (.item with $x.?sum) || 0
camelia Cannot resolve caller sum(Any:U: ); none of these signatures match:
(Any:D: *%_)
in block <unit> at <tmp> line 1
codesect` m: my $x; say $x.&sum//0
camelia Cannot resolve caller sum(Any:U: ); none of these signatures match:
(Any:D: *%_)
in block <unit> at <tmp> line 1
jmerelo codesect`: tried that above. It's the multi
It says it will call "if there's a method of such name". But then, it might fail because of the signature 17:45
codesect` Yeah, I thought the & might change that
m: my $x; my sub sum(|) {}; say $x.?&sum//0 17:46
camelia 0
codesect` that's slightly hacky, but works without any parens 17:46
jmerelo m: my $x=3; my sub sum(|) {}; say $x.?&sum//0 17:47
camelia 0
jmerelo codesect`: not really...
codesect` mmmmm
moritz weekly: news.perlfoundation.org/post/rakua...rt-2021-04 18:45
notable6 moritz, Noted! (weekly)
kiti_nomad[m] Learning raku these days 18:59
moritz kiti_nomad[m]: good choice :D 19:04
tbrowder hi, where can i find out about the new mailing list [email@hidden.address] 22:51
lizmat tbrowder: not so much a mailing list as an alias that lives on my mail server 22:52
just send a message to it for subscribing, and I will "subscribe" you if you want :-)
tbrowder thnx 22:53