00:38 uzl[m] left 00:39 CIAvash left 00:56 greencurtain joined 00:57 greencurtain left 01:04 uzl[m] joined 01:06 frost joined 01:30 zmoment left 01:42 zmoment joined 02:07 CIAvash joined 02:43 Kaipei left 03:18 Guest35 left 04:06 Kaipei joined 06:55 m_athias left 06:56 m_athias joined 08:06 dakkar joined 08:14 mayd78 joined 08:15 mayd78 is now known as mayd17
mayd17 hi, on Windows, on the command line, I do this: `raku -e 'say "-" ~ 1'` 10:45
and I get `-1` as expected 10:46
then I do `raku -e 'say "-" ~ 0'`
but I get `0`!
if I interchanged the single/double quotes, both work fine 10:47
is this due to powershell?
Nemokosch what if you `echo 'say "-" ~ 0'`? 10:52
mayd17 then i get `say "-" ~ 0`
on Ubuntu both single and double quote combinations work for both 0 and 1 fine 10:54
Nemokosch and what if you start the raku repl and run say "-" ~ 0 there?
and what if you start the raku repl and run `say "-" ~ 0` there?
mayd17 then I get `-0` no problem
Nemokosch I know 😄 10:55
mayd17 I also tried a script before that with that line, works okay
then why did you ask :d
oh, rheotrical questions? :d
if so, i didn't get the thing
oh you said I know to the Ubuntu thing, right? sorry okay 10:57
Nemokosch yeah 11:02
mayd17 context: i was trying to rename many files whose names follow the pattern `file(\d+).png` but numbers in them start from 1; I needed them 0-indexed. Also, a hyphen before the digits is needed, i.e., `file-(\d+).png`. I thought I can do with Raku on the command line with `raku -e 'rename($_, .subst(/(\d+)/, {"-" ~ ($0 - 1)})) for dir'` 11:25
and it works except for `file1.png` to `file-0.png`. It gave `file0.png` instead. 11:26
Nemokosch time to ask Coke I guess 11:29
mayd17 should I drink something? :d
lizmat Coke is offline until tomorroqw 11:33
Nemokosch so you say "-" ~ 0 itself evaluated to '0'?
mayd17 oh Coke is a user here, so sorry 11:37
yes it gives `0` when I do `raku -e 'say "-" ~ 0'`
if I do with `-8` instead of `0`, it gives `8` 11:39
if I do with `7` instead of `0`, it gives `-7` 11:40
Nemokosch I'm confident the order of evaluation is bad some way 11:41
like the string is interpolated by your shell, not Raku, or something like that 11:42
you said Powershell? 11:43
mayd17 yes 11:46
Nemokosch well what is still possible is that the -e switch itself passes the argument wrong 11:52
this is why it would be good if you could run your stuff from the repl
mayd17 worse things happen with perl, so powershell is doing some uninteresting things 12:56
though, it gives a syntax error, maybe that's not worse not sure 12:57
syntax error around double quotes inside
13:37 Guest35 joined 14:27 frost left 16:40 dakkar left
Bscan🍺 ``` 17:48
sub foo($bar) {
print "Hello";
Gives a pretty good error that "Error while compiling: Calling foo() will never work with declared signature ($bar)". However this error doesn't show up when you run raku -c on this script. Why wouldn't -c catch this compilation error?
MasterDuke -c is really just (currently) a syntax check. i don't know if there's more planned to be done with it 18:49
Bscan🍺 Thanks! I think I was just surprised that another compilation step happened in between -c and code execution. 19:39
MasterDuke currently the optimizer also does some correctness checking. part of the current rakuast effort is to split that out into more well defined stages 19:40
Nemokosch rakuast always shows up 19:43
it's almost like an inside joke at this point 😄
20:00 n1to joined
Bscan🍺 Haha, thanks. I suppose my follow up question would be how to trigger the optimizer from nqp::getcomp. I'm building a language server (see marketplace.visualstudio.com/items...-navigator ) and using the parsing method from github.com/Raku/Raku-Parser which doesn't do the optimizer stage. Have you seen any examples of parsing with the optimizer? If I can squeeze out b 20:17
Nemokosch o.O very nice 20:21
MasterDuke you'd have to compile the code i believe
github.com/rakudo/rakudo/blob/mast...m6#L43-L72 might be relevant 20:22
or ping nine, lizmat, vrurg, etc over in #raku-dev 20:23
Bscan🍺 Thanks. I'll try to get it working this weekend, and then perhaps ping them for a quick code review. 20:42
21:27 n1to left