Raku Conference Day 2 on Youtube: www.youtube.com/watch?v=BL9-XdC9WYI 🦋 Welcome to the MAIN() IRC channel of the Raku Programming Language (raku.org). Log available at irclogs.raku.org/raku/live.html . If you're a beginner, you can also check out the #raku-beginner channel!
Set by lizmat on 14 August 2022.
Nemokosch For the first time in my life, I feel I found a use for "scalar is one-element array" 😄 07:42
gfldex I just wrote `LAST say (ENTER ++$), ‘ rounds’;` and I liked it. 11:27
tbrowder tonyo: i'm having trouble github testing with a module using Text::CSV::LibCSV. it tests fine locally on my debian box. mine uses mi6's workflow with the following line added to test.yml: "run: sudo apt-get install -y libcsv-dev" 13:24
can you trigger yr mod to see if it still tests ok on github? 13:25
thanks 13:26
p6steve nemokosch - do share the use case for Scalar is a one element array 14:11
Nemokosch I needed to write a function that can operate both on an element type and a list of that type 14:31
I can use the same for on decont data if it's the supposed list, or the scalar data if it's an element 14:32
Not having to worry that the element might be a list itself 14:34
tonyo tbrowder: just an empty CI build? 16:22
tbrowder hi! trying to debug now. i’m trying to convert yr module to github testing with workflows 16:24
in the past i haven’t used yr mod with a published module so haven’t had a problem 16:25
now i want to use it with two new modules 16:26
so i need it to work with .github 16:27
tonyo oh nice, you want me to kick off an empty CI build for that repo to make sure it's still OK?
tbrowder i don’t know anything about circleci 16:28
tbrowder i thought we were getting away from travis and the other non-github testers 16:29
raiph anyone know bisectable6?
tbrowder tonyo: yes, pls 16:30
raiph if so, can one use it to test a MAIN which needs some stdin?
tbrowder i know you need to chg c code to (int options) to remove a compiler warning 16:31
i also chgd Build.pm to Build.rakumod 16:34
leont m: class Value { method COERCE() { Value } }; multi foo(Hash:D) {}; multi foo(Value(Any:D)) {}; foo({ :foo }) 16:48
camelia Ambiguous call to 'foo(Hash)'; these signatures all match:
(Hash:D $)
(Value(Any:D) $)
in block <unit> at <tmp> line 1
leont That is a bug, right?
Clearly the hash should dispatch to the hash multi
[Coke] doesn't think he's ever seen "Value" before. 16:54
... oh, because it's defined right there. :)
tonyo tbrowder: will do, cannot at the moment 17:03
p6steve m: sub fn($x) {say $x.first}; my $a = 42; fn($a); my @b = 1,2,3; fn(@b); 18:07
camelia 42
1
p6steve nemokosch: I imagine something like this ... interesting 18:08
tellable6 p6steve, I'll pass your message to Nemokosch
tbrowder .tell tonyo no rush, i'm working now on a PR for Text::CSV::LibCSV to use github workflows 18:14
tellable6 tbrowder, I'll pass your message to tonyo
guifa I feel like i remember someone asking this a few days ago 18:17
Let's say I want arguments for MAIN() to be a literal string starting with a hyphen ... how can?
lizmat raku -e '@*ARGS.unshift("--"); sub MAIN(|c) { dd c }' --foo 18:25
guifa ^^
guifa Okay that works but … how LOL 18:27
lizmat any arguments after a -- are not interpreted in any way
guifa Yeah, I just thought that @*ARGS represented the arguments 18:28
so if you did @*ARGS.unshift('foo'), it would ignore things beginning with foo? 18:29
raku -e '@*ARGS.unshift("foo"); sub MAIN(|c) { dd c }' foo
lizmat no
no, the unshift just makes it look like: 18:30
raku -e 'sub MAIN(|c) { dd c }' -- --foo
guifa is making an interface where -z is "don't include z as a possibility" and +z is "require z in output" in a generator 18:35
Voldenet why not –include-z –exclude-z 18:51
guifa because takes too long to type ha
it's a password generator
pwgen 16 -s +uln 18:52
"generate a 16 digit passsword, don't use symbols, but must include upper, lower, and numbers"
Voldenet too long? My solution is `cat /dev/random | tr -dc '[:alpha:]' | head -c8 | add-password [email@hidden.address]
too long? My solution is `cat /dev/random | tr -dc '[:alpha:]' | head -c8 | add-password site@whatever.com'
now that's too long to type :D 18:53
guifa hahaha
tonyo don't you get that for free with the bool type?
tellable6 2022-09-02T18:14:25Z #raku <tbrowder> tonyo no rush, i'm working now on a PR for Text::CSV::LibCSV to use github workflows
guifa I'm pretty sure that's what Firefox does — but it's alpha only which is annoying when sites require numbers or symbols. 18:54
Voldenet I wish you could create accounts just by sending properly formatted email
tonyo raku -e 'sub MAIN(Bool :$z = False) { dd $z; };' -z # true 18:55
raku -e 'sub MAIN(Bool :$z = False) { dd $z; };' -/z # false
Voldenet (I wonder why people insist on sending verification emails when they could receive the verificatione mail) 18:56
ToddAndMargo Found something interesting.  I have a `BEGIN {}` that I use for a splash screen.  `-c` executes the BEGIN {}, not just syntax check it.   This suppose to happen? 19:52
Fedora 36
rakudo-pkg-2022.6.0-01.x86_64
$ raku -c GetUpdates.pl6
Syntax OK
Voldenet ToddAndMargo: BEGIN blocks run at compile time by design, so yes 20:18
it's a gift and a curse I suppose
You could use environment variable or argument to silence it 20:20
guifa You may want INIT instead of BEGIN — INIT runs at script execution, rather than compile 20:24
Voldenet guifa: the problem was that compilation took too long 20:27
over 20s iirc
and splash screen has to show up for those 20s
It could be solved by having script spawn splash screen and pass its handle/id/whatever to the "real" script that takes longer to run 20:29
Which wouldn't be as cool as using BEGIN, but more predictable
ToddAndMargo Oh I do not mind it.  I was just perplexed by it.   I do typically run -c before to catch all my stinkin' typos before I run the program itself.  and the programs works the way I want with the BEGIN as it is.   Thank you for the explanation and tips: "it's a gift and a curse I suppose" 20:48
ToddAndMargo I make a call to zenity with an "okay" to dismiss the pop up.  I though that was sweet.  Sometimes splash screens can be annoying trying to work around them 21:13