🦋 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 6 September 2022.
00:00 reportable6 left 00:02 reportable6 joined
Homer_Simpson my code is saying its line 0 if I make it 6 which is wrong pastebin.com/3NbJTa2k 00:33
oops here pastebin.com/3NbJTa2k 00:34
tonyo what's in data.ldr 00:40
Homer_Simpson 6 6 00:44
and this is saying invalid line type if I make it 0 6 : pastebin.com/rUYmSJws 00:45
even eq isnt working 01:00
01:02 jpn joined
Homer_Simpson anyone here 01:06
01:08 raschipi joined 01:10 jpn left
:(**@rest, *%rest) me 01:21
tonyo m: dd "6" && " ";
camelia " "
:(**@rest, *%rest) Homer_Simpson: it looks like bad code tbh 01:22
stevied /tonyo left you a present, earlier
tonyo ^^
stevied here ya go: github.com/tony-o/raku-fez/issues/80 01:23
:(**@rest, *%rest) Homer_Simpson: also you can try dd @x
stevied blank lines in .gitignore cause problems for fez
tonyo stevied: i have a branch that may fix if you're savvy 01:24
stevied i wouldn't call myself savvy, just know enough to be dangerous
tonyo the `glob` branch *should* fix that error, i'm currently testing before releasing 01:25
the current way is entirely wrong and sometimes that regex ends up with zero files so pax|tar hangs waiting on stdin
stevied what's weird is that the pax command seems to complete, it's only when .exitcode is called on it do things hang, afaict. 01:26
not sure exactly what's going on with that
i'll wait for official release. solved the problem by just deleting the blank line 01:27
Homer_Simpson present?
stevied o 01:28
Homer_Simpson the last thing I see on my irc is: <tonyo> what's in data.ldr
stevied i'm not 100% sure, but I think the blank line in .gitignore was causing mi6 to choke: github.com/skaji/mi6/issues/166#is...1399647182
01:29 Homer_Simpson is now known as pingu
i was able to install a module with 2022.12 that I couldn't earlier after getting rid of blank line 01:29
:(**@rest, *%rest) Homer_Simpson: do you have a discord 01:30
pingu yes 01:33
ill check it
I wasnt logged in 01:34
so I cant see the chat history
oh wait is it #raku-irc not #general ? 01:35
:(**@rest, *%rest) raku-irc is different from general 01:36
Saul Goodman I see say "6" && " "; but I dont see how that would help 01:38
2 mins
:(**@rest, *%rest) can you recreate the data.ldr or just send the file 01:39
@Saul Goodman 01:41
Saul Goodman the data is 6 6 01:43
but if I do when ("0" && " ") I get "line is ype 0"
which is wrong
because its 6 01:44
:(**@rest, *%rest) "0" && " " is " " i think 01:46
raschipi m:"0" && " " 01:49
evalable6 WARNINGS for /tmp/ItQOvvBmD8:
Useless use of constant string " " in sink context (line 1)
01:50
raschipi m: say "0" && " "
camelia
:(**@rest, *%rest) m: dd '0' && ' ' 01:52
raschipi m: dd '0' && ' ' 01:53
camelia " "
:(**@rest, *%rest) back to @Saul Goodman
what error do you have exactly
Saul Goodman theres no error its printing the wrong result 01:54
my file is 6 6 but the console is saying that its line 0
:(**@rest, *%rest) no? 01:55
it says invalid line type
raschipi If you smartmatch against True, it's always success. 01:56
Ops, please ignore what I said, && returns the argument.
Saul Goodman I'm telling you what error I have with my code 01:58
though its not so much an error per se
pastebin.com/gnC4jUQ5 01:59
:(**@rest, *%rest) i recreated it here glot.io/snippets/ghq0smqf9n
don't know what are you expecting 02:01
Saul Goodman that code does not work if I make it 0 6
(in the file) 02:02
:(**@rest, *%rest) i saw the problem @[0][0..1] is not a string 02:05
but you matched it against one
Saul Goodman its a sequence 02:06
according to dd
:(**@rest, *%rest) you have to join them 02:08
glot.io/snippets/ghq0smqf9n
Saul Goodman aight that works 02:09
02:22 epony left 02:23 epony joined 02:34 jpn joined 02:41 jpn left
tonyo stevied: if you could install the glob branch of fez and give it a go it'd much appreciated 02:47
stevied /tonyo ok, will do. is there a way to do a "fake" upload 02:49
I'd like to test it without actually uploading
I can throw an exit; in the code for now but wondering if there is a better way 02:50
i'm getting a message that "Directory version(0.0.10) appears to exist" 02:56
i guess some kind of check was added in the glob branch? how do I circumvent that?
03:01 codesections left 03:06 razetime joined 03:29 jpn joined 03:34 jpn left
tonyo stevied if you upload you have about 24 hours to run a fez remove <full dist, same that's output when you `fez list`> 03:43
the other option is doing something like an ACME package, that's what i use to test things
(Fez::ACME), it's just an empty module 03:44
rf When would I ever use try? 03:46
raschipi To separate error handling from normal code. Say an exception is very unlikely, you don't want to keep the code that deals with it mixed in normal flow. 03:50
stevied yeah, used the earlier today, in fact.
rf Makes sense 03:56
04:01 rf left 04:05 razetime left 04:21 pingu left 04:24 jpn joined 04:30 jpn left 04:45 raschipi left
tonyo also optionally including functionality if some module exists 04:50
try require ::("Terminal::ANSIColor")
shmup messing around with raku. i have a socket listener and it's just echo'ing back the $conn.line from a client connection, if i ^c then my react block blows up "Malformed UTF-8". can someone point me to a doc that can set me straight? is there a convention that isn't trying to catch it? 04:54
05:01 perryprog left, oodani_ left 05:02 MasterDuke left, energizer left 05:11 oodani joined 05:12 perryprog joined, energizer joined 05:22 razetime joined 06:00 reportable6 left 06:02 reportable6 joined 06:11 jpn joined 06:18 jpn left 06:34 jpn joined 06:38 jpn left 06:50 Kernspin left 06:51 Kernspin joined 07:23 snonux joined 07:51 rantanplan joined 07:57 jpn joined 08:04 jpn left 08:56 Sgeo left 09:09 Xliff joined 09:30 jpn joined 09:38 jpn left 10:02 jjido joined 10:10 sena_kun joined 10:11 Kernspin left 10:12 Kernspin joined 10:16 Kernspin left 10:18 Kernspin joined 10:26 jpn joined 10:58 jjido left 10:59 jjido joined 11:19 rantanplan left, snonux left 11:21 jjido left 11:22 jjido joined 11:24 ab5tract joined 11:41 lichtkind joined 11:46 jpn left 11:52 Kernspin left 11:53 Kernspin left, jjido left 11:56 Kernspin joined 12:00 reportable6 left 12:01 reportable6 joined 12:11 rantanplan joined, rantanplan left, snonux joined 12:12 snonux left, snonux joined 12:17 snonux left 12:23 razetime left
:(**@rest, *%rest) are objects that don’t have .Bool coercer implemented always truthy? 13:09
13:12 razetime joined
lizmat m: dd Mu.Bool 13:16
camelia Bool::False
lizmat m: dd Mu.new.Bool
camelia Bool::True
lizmat that's your default .Bool
it's true if it is instantiated, else not
13:17 ab5tract left
:(**@rest, *%rest) hmm ok 13:20
13:54 raschip joined 14:12 razetime left 14:13 jpn joined 14:18 jpn left 15:18 linkable6 left, evalable6 left 15:19 linkable6 joined
m: say '2' ~~ /[0-9]/ 15:19
15:20 evalable6 joined
m: say '2' ~~ /<[0..9]>/ 15:20
hmm
Nemokosch for what? 15:22
15:23 jpn joined, cfa joined
:(**@rest, *%rest) why does /[0-9]/ give an error 15:26
Nemokosch first you tell me: what behavior you'd prefer? 15:27
15:30 jpn left
:(**@rest, *%rest) i want to parse characters in between 0 and 9 15:31
/[0-9]/ is how i would do it better yet /\d/ but im talking more general than that 15:33
/[0-9]/ instead in raku throw an error 15:34
raschip [...] in a Raku regex is a non-capturing group, not a character class 15:37
:(**@rest, *%rest) m: say '0-9' ~~ /[0-9]/ 15:38
15:38 rf joined
what 15:38
m: say '0-9' ~~ /0-9/ 15:39
raschip m: say '0-9' ~~ /[0\-9]/
camelia 「0-9」
Nemokosch yeah ultimately you'd want to learn Raku regexes
raschip You need to quote the -
:(**@rest, *%rest) how can yours work
like \-? 15:40
raschip yep
m: say '0-9' ~~ /0\-9/
camelia 「0-9」
:(**@rest, *%rest) m: say '0-9' ~~ /0\-9/
Nemokosch it doesn't show up in the bridged message
misleading
:(**@rest, *%rest) discord ate away the \ 😭
Nemokosch tbh I'd rather really quote strings inside a regex 15:41
even looks better usually
and it's more transparent overall
15:45 jpn joined
:(**@rest, *%rest) the repetition operator in raku regex is ** 15:49
raschip Yep, exponentiation
aaa == a**3
:(**@rest, *%rest) m: regex ip-num { \d**1..3 } regex ip { (<ip-num>) '.' (<ip-num) '.' (<ip-num) '.' (<ip-num) } say '192.168.1.1' ~~ ip; 15:51
15:51 jpn left
m: regex ip-num { \d**1..3 } regex ip { (<ip-num>) '.' (<ip-num>) '.' (<ip-num>) '.' (<ip-num>) } say '192.168.1.1' ~~ ip; 15:51
bruh
15:54 perlbot left, simcop2387 left
raschip m: '192.168.1.1' ~~ /(\d**1..3)**4 % '.'/ 15:57
camelia ( no output )
raschip m: say '192.168.1.1' ~~ /(\d**1..3)**4 % '.'/ 15:58
camelia 「192.168.1.1」
0 => 「192」
0 => 「168」
0 => 「1」
0 => 「1」
:(**@rest, *%rest) m: my regex ip-num { \d**1..3 } my regex ip { <ip-num>**4 % \. } my $match = '192.168.1.1' ~~ &ip; dd $match; 15:59
m: my regex ip-num { \d**1..3 } my regex ip { <ip-num>**4 % \. } my $match = '192.168.1.1' ~~ &ip; say $match; 16:00
raku regex are more complex and feature rich than perl/pcre regex lol 16:01
16:03 snonux joined, snonux_ joined
m: my regex hex { ‘0x’? <[\dA..Fa..f]>+ } say ‘DEAD’ ~~ &hex; 16:06
m: my regex hex { ‘0x’? <[\dA..Fa..f]>+ } say ‘0x1234DEAD’ ~~ &hex;
raschip Of course Raku regexes are more feature rich than Perl re, they are used to parse Raku itself... 16:07
:(**@rest, *%rest) i thought pcre is as complex as it can get
raschip Well, they are, really, but the features that make them as complex as Raku's are obscure and hard to use. They are Turing-complete, after all. Raku's regexes make those features way easier to use. 16:09
:(**@rest, *%rest) m: my regex hex-prefix { ‘0x’ } my regex hex-digit { \d | <[A..F]> | <[a..f]> } my regex hex { <hex-prefix>? <hex-digit>+ } say ‘0x1234Dead’ ~~ &hex; 16:10
i think this time i can use a grammar?
raschip Regexes and Grammars are the same thing, really, just two ways of declaring the same objects. Use whatever is more convenient... 16:12
:(**@rest, *%rest) ok so raku regexes are both used for lexing and parsing... grammars are just regexes under the hood 16:13
16:17 snonux left 16:18 snonux joined 16:38 snonux left, snonux_ left 17:13 derpydoo joined 17:18 snonux joined, snonux_ joined 17:35 jgaz joined
rf Can I make zef run tests in the it/ directory for integration tests? 17:43
[Coke] rf; "zef test ." ? 17:49
oh, it/ isn't a typo. hmm 17:50
17:50 jpn joined 17:52 derpydoo left
rf Yeah like if I have tests in it/ 17:57
or xt/
17:57 djerius left 18:00 reportable6 left
[Coke] github.com/ugexe/zef/blob/main/lib...kumod#L106 18:01
Looks like the t is hardcoded
18:03 reportable6 joined 18:10 jpn left 18:24 eseyman left, jjido joined 18:30 simcop2387 joined 18:32 perlbot joined, jpn joined 18:34 cfa left
rf Darn 18:42
ugexe: Is there any way to run tests in it/ and t/ with zef? 18:43
18:43 p6steve joined
ugexe no, like tests in e.g. xt/ are run during authoring/development typically and so the functionality doesn't really need to exist for general distribution consumption. i usually run my xt/ tests in CI manually via `raku -I. xt/my-test.rakutest` or like `prove6 -I. xt/` 19:00
so theoretically i might add xt/, but then you're asking for it/ which shows other people will want foot/ etc 19:01
rf Makes sense 19:11
Thanks for the response
ugexe another technique is running like SKIP-ALL() or whatever it is unless some ENV var is set 19:19
so put all your tests in t/, but at the top of the test check for %*ENV<RAKU_AUTHOR_TESTS> or some such
then you can do `RAKU_AUTHOR_TESTS=1 zef test .` 19:20
rf I just added prove6 to my CI pipeline I think it'll be fine, realistically I'll be the only one authoring this so if it fails CI and gets authored that's more of a me problem 19:24
19:25 Sgeo joined 19:31 epony left 19:33 jpn left 19:52 eseyman joined 20:05 jpn joined 20:15 jpn left 20:19 xinming joined 20:58 epony joined 21:00 Sauvin left 21:01 Sauvin joined 21:07 snonux left, snonux_ left 21:10 jgaz left 21:11 pingu joined
ugexe yeah thats how i handle it as well with zef, which has xt/ 21:19
well i just run `raku -I xt/tet-name.rakutest` but yeah the same sentiment
pingu is there a way to do this without having to do .join pastebin.com/jL3smrqy 21:25
the contents of data.ldr is: 0 0\n1 0\n2 0\n3 0\n4 0\n5 0\n6 0\n 21:26
also im getting error: Type check failed in binding to parameter '$address'; expected Str but got Any 21:27
validateline type should not have to start making new arrays and joining stuff
just for @x -> @line works but I wanted to pass the line number as a range or an int as a function argument 21:31
not have the function hardcoded to just do all lines at once 21:32
ok I fixed one thing, this works: given (@x[0][0] ~ @x[0][1]) 21:38
now I dont need the for loop
Nemokosch could you quickly say what you are trying to achieve? 21:40
pingu its fine I fixed it 21:41
only problem is, I thought <space>0<space>0\n would be invalid ldraw but its valid so now I gotta change the code again 21:42
so: my $line = 0; my $index = 0; loop (@x[$line][$index] = 0 ; @x[$line][$index] le chr(32) ; $index++) { #`{...}`} 21:48
raschip v6.e.PREVIEW isn't available in the REPL? 21:55
21:59 thundergnat joined
thundergnat m: gist.github.com/thundergnat/ff2f5e...0b28e9e68c 21:59
camelia 0
1
2
3
4
5
-1
-1
3
4
0
thundergnat pingu: seems like you are doing an awful lot of extra work. See the above gist ^^ 22:00
pingu yes but at least im learning, not just copying other peoples code 22:03
ill try this thx 22:04
thundergnat 👍 Kudos for learning. Nothing wrong with copying either, as long as you are doing it to gain understanding. 22:06
22:13 jpn joined 22:18 jpn left 22:33 jpn joined 22:36 sena_kun left 22:44 jpn left 22:46 jjido left 23:00 jpn joined
Nemokosch raschip: the way the REPL works is, well, not very smart, simply put 23:02
it doesn't actually create a compilation unit, for example, so it cannot set a version 23:03
maybe if you can get rakudo execute stuff before opening the REPL
23:05 jpn left, jpn joined 23:06 Air4x joined
pingu: what thundergnat said + please keep in mind that Raku is kind of a language with batteries, a nuclear reactor, a swiss army knife and a space station included 23:06
one of the most common things to happen is "oh why did nobody tell me this cool thing existed"
23:10 jpn left
raschip Nemokosch: True, but I'm having REPL problems lately and I wasn't sure if it was just me or a general thing, thanks. 23:11
tellable6 raschip, I'll pass your message to Nemokosch
Nemokosch freshly defined operators also wouldn't work, as another example 23:12
23:24 jpn joined
tonyo . 23:37