🦋 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.
antoniogamiz o/ 08:32
any idea why this regex is not working?
m: > "7710BE40DEE87AED4CAFCC5C2D350391227AD5E2" ~~ /[0..9A..F] ** 5..40/ 08:33
evalable6 (exit code 1) 04===SORRY!04=== Er…
antoniogamiz, Full output: gist.github.com/cb112a14654a96aa5f...94b2934425
antoniogamiz m: "7710BE40DEE87AED4CAFCC5C2D350391227AD5E2" ~~ /[0..9A..F] ** 5..40/
evalable6
antoniogamiz solved! 08:38
m: > "7710BE40DEE87AED4CAFCC5C2D350391227AD5E2" ~~ /<[A..Z 0..9]> ** 5..40/
evalable6 (exit code 1) 04===SORRY!04=== Er…
antoniogamiz, Full output: gist.github.com/ee6c7bdc3e6a1e43ec...f09b1799ef
antoniogamiz m: "7710BE40DEE87AED4CAFCC5C2D350391227AD5E2" ~~ /<[A..Z 0..9]> ** 5..40/ 08:39
evalable6
antoniogamiz ah, in my machine works mm
Geth doc: 76c8fbb5c4 | (JJ Merelo)++ | doc/Type/Num.pod6
Adds Num.new, including coercion

Refs #2632
08:44
linkable6 Link: docs.raku.org/type/Num
DOC#2632 [open]: github.com/Raku/doc/issues/2632 [Hacktoberfest][RFE][big][docs][good first issue][help wanted][new][⚠ Top Priority ⚠] Checklist for 6.d
chloekek p6: say 'a' cmp 1 10:26
evalable6 More
tellable6 2020-02-25T10:25:28Z #raku-dev <lizmat> chloekek could you give a reply on www.reddit.com/r/rakulang/comments...e_in_raku/ with regards to the status of your GSOC project of last year ?
chloekek lizmat: I’ve never done a GSOC project. 10:27
lizmat chloekek: oops, I guess I got it wrong then... :-) 12:35
sorry for the noise
cpan-raku New module released to CPAN! Gnome::N (0.15.6) by 03MARTIMM 13:20
cpan-raku New module released to CPAN! Math::Libgsl::Constants (0.0.3) by 03FRITH 15:33
cpan-raku New module released to CPAN! Math::Libgsl::Random (0.0.1) by 03FRITH 16:57
rypervenche Is using "note" like this typical for what I'm trying to do? gist.github.com/rypervenche/5d3536...95b959745d 17:23
tobs rypervenche: note prints to $*ERR, so that seems good to me. 17:26
rypervenche Cool. I see people using "die" and maybe "fail" a lot in code, but I didn't want all of the errors in my output and I haven't seen any code yet that uses note. I'll have to read some more application-type code. :) 17:27
tobs but the check itself could be easy to circumvent, if the person calling the script has access to the environment
tobs die could be another option. Instead of directly exiting from some function like you do, die raises an exception that can be regularly caught by some caller of your function if they know better than to exit the program. 17:31
rypervenche Well, the script is in my normal user's git repo in its home directory, so I thought this would be a good way to check. I'm converting a bash script into Raku. It was simpler in Bash: [ $UID != 0 ] && echo "You are not root. Exiting..." && exit 1
tobs The problem is you're not checking the UID of the user running the process. You're checking some string that is in the USER environment variable. Someone with shell access can write anything they like into that variable including non-existent usernames or root. 17:33
rypervenche That's true...
tobs m: dd $*USER 17:35
evalable6 IntStr.new(1005, "bisectable")
lizmat m: dd +$*USER # pretty sure that cannot be faked easily 17:37
evalable6 1005
lizmat m: dd ?$*USER
evalable6 Bool::True
lizmat m: die "You are not root. Exiting..." if +$*USER 17:38
evalable6 (exit code 1) You are not root. Exiting...
in block <unit> at /tmp/qgx5TUV4K_ line 1
rypervenche Oooh 17:42
knowledge++ 17:43
tobs Is there a way to cancel a Promise.in()? 22:02
lizmat tobs: Promise.in is a wrapper around ThreadPoolScheduler.cue 22:13
docs.raku.org/routine/cue
that returns a Cancellation object
the Promise wrapper does not expose that
tobs ha, I *knew* I had read Cancellation before 22:14
SmokeMachine tobs: if you use it inside a react and done() that, it’s autocanceled (if I remember ir right) 22:38
tobs sadly no, I set it off to tick in the background. But I solved my immediate problem in a different way meanwhile. 22:40
Poohman hello all, if I use a grammar and parse, how can I check if a match has been found? 22:57
if the parse has failed, then is it considered as Any?? 22:59
Poohman m: say "test"; 23:06
evalable6 test
Poohman m: grammar A {token TOP {\d*}};my $match = A.parse("a");say $match; 23:08
evalable6 (Any)
Poohman m: grammar A {token TOP {\d*}};my $match = A.parse("1");say $match;
evalable6 「1」
Poohman What is the idiomatic way to check if I have a match? 23:09
m: grammar A {token TOP {\d*}};my $match = A.parse("1");say $match.WHAT;
evalable6 (A)
Poohman m: grammar A {token TOP {\d*}};my $match = A.parse("1");given $match.WHAT {when A { say " I have a match"}}; 23:11
evalable6 I have a match
leont A failing match is false and undefined 23:13
Poohman thanks 23:14
got a bit confused because of the Any
leont I think that using dd instead of say helps in understanding what's going on 23:20
A successful match returns a defined Match object 23:22