🦋 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.
tbrowder__ *arg, ignore all AFTER the WITHOUT 00:00
[Coke] what version of rakudo do you have? 00:52
I'm guessing you either have a very old version or you have more stuff in the code that we're not seeing. (The @a loop works fine here on the command line) 00:54
tbrowder__ yep, i'm still looking, very ugly stuff... 02:03
tbrowder__ a eureka moment: spaces around the elipsis generator causes problems 11:00
m: say 0,3...10 11:01
camelia (0 3 6 9)
tbrowder__ m: say 0,3 ... 10
camelia (0 3 6 9)
tbrowder__ hm
m: say 0, 3 ... 10 11:02
camelia (0 3 6 9)
tbrowder__ wow, my host is hosed!!!! 11:03
Nemokosch lol
tbrowder__ m: say 0,128...^512 11:05
camelia (0 128 256 384)
tbrowder__ m: say 0, 128 ... ^512
camelia (0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86…
Nemokosch gotcha!
tbrowder__ aha, that's what i've been seeing 11:06
Nemokosch m: 0, 128 ... ^512 andthen .say 11:06
Raku eval (0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 ...)
Nemokosch oh right, I remember 11:07
goddamnit
tbrowder__ m: say 0,128 ...^512
camelia (0 128 256 384)
Nemokosch ... ^number is NOT the same as ...^ number 11:08
tbrowder__ m: say 0, 128 ...^ 512
camelia (0 128 256 384)
Nemokosch ^512 is a range on its own that expands to 0, 1, 2, ...., 511
and this sequence will be used asthe "endpoint" of the whole sequence 11:09
tbrowder__ so, keep the caret attached to the ellipsis
tbrowder__ looks like a candidate dor docs traps to avoid 11:10
Nemokosch: good analyis
Nemokosch github.com/rakudo/rakudo/issues/3881
tellable6 tbrowder__, Sorry kid, that's not my department.
Nemokosch 🤣
anyway, I have seen this issue recently 11:11
and this is among the issues that I'm convinced could be just solved, rather than a) explained away b) dumped into the "traps" section 11:13
i.e no, the right handside should not collapse into a sequence of values 11:14
tbrowder__ nevertheless, the immediate fix should be doc trap note imho 11:15
back to using sequence "the right way" for now :-D (but i DO LOVE RAKU) 11:16
Nemokosch well, I for one don't like when something that feels wrong gets documented either way. It's like a justification of a mistake. 11:17
this is not to say that a language can be both useful and without traps 11:18
but the traps should obviously be a shorter list than the useful use cases 11:19
tbrowder__ no argument from me kiddo 11:22
but i would 11:23
Nemokosch so yeah, just as much as "nobody prevents me" from finding a better way
I don't prevent anybody from adding it to the traps - as long as later on it can be eliminated
tbrowder__ was gonna say i would give up ^6 as a range, i always thought it just means 5 11:24
Nemokosch m: (^*)(10).say 11:25
Raku eval ^10
tbrowder__ well, gotta run and raku on; ta ta, all
Nemokosch thank you for the descriptive representation 😄
m: (^*)(10).list.say
Raku eval (0 1 2 3 4 5 6 7 8 9)
Nemokosch the curse of doing "too clever" stuff 11:26
like it makes sense that ^10 is a range, and frankly that's a common paradigm by now
but I can also see your point that ^ usually just means "right before" when you read ..^ or ...^ 11:27
tbrowder__ couldn't resist a visit back. i'm a simple man and can't immediately imagine a personal need for the ^10 as a range. however, part of the beauty of raku is its power to do what you mean (and need), so i'm all for "fixing"/ 11:47
*fixing it if possible
fixing the ... ^ issue that is 11:48
guifa So it looks like the main stumbling block for me on speed of doing localized formatting (based on DateTime.Str which isn't passed off to lower levels) is that it's done in NQP, because my code for an ISO formatted string ends up being nearly identical 15:13
probably combination of that and of accessing attributes of DateTime objects (where the .Str method can directly access them via $!foo)
guifa just had his first real-world use of andthen 15:47
Nemokosch how come? xD 15:58
jdv has never 16:10
guifa Assigning a callable to a hash key and then returning the called valuee 16:54
%foo<bar> = generate-callable(…) andthen .(…)
(as the last line of a sub, otherwise, `andthen return .(…)` ) 16:55
Nemokosch this one could be seen as a trap as well, I'd say 😄 17:14
tbrowder__ m: my Array enum P << :A4[0,0,595,842]>>; say P.gist 17:16
camelia (P)
tbrowder__ m: my Array enum P << :A4[0,0,595,842]>>; say P.[0]
camelia (Any)
tbrowder__ m: my Array enum P << :A4[0,0,595,842]>>; say P[0] 17:17
camelia ===SORRY!=== Error while compiling <tmp>
P cannot be parameterized
at <tmp>:1
------> enum P << :A4[0,0,595,842]>>; say P[0]⏏<EOL>
tbrowder__ m: my Array enum P << :A4[0,0,595,842]>>; say P::A4
camelia A4
tbrowder__ m: my Array enum P << :A4[0,0,595,842]>>; say P::A4.raku
camelia P::A4
tbrowder__ m: my Array enum P << :A4[0,0,595,842]>>; say P::A4.gist
camelia A4
tbrowder__ m: my Array enum P << :A4[0,0,595,842]>>; say P::A4 17:20
camelia A4
tbrowder__ m: my Array enum P << :A4[0,0,595,842]>>; say P::A4.raku
camelia P::A4
guifa Nemokosch: and what's the trap? the alternative is "%foo<bar> = generate-callable; return %foo<bar>(…)", or even .(…) with %foo<bar> = generate-callable (minus the tiny difference between with and if) 17:46
tellable6 guifa, Sorry kid, that's not my department.
guifa wait wot
tbrowder__ the array of enums is deep inside PDF::Document. i can get the data aout manually but how does one access the value for A4 in this code: my Array enum PageSizes << :A4[0,0,595,842]>>; 18:10
s/aout/out/ 18:11
guifa tbrowder: PageSizes.enums<A4> 18:13
m: my Array enum PageSizes << :A4[0,0,595,842]>>; PageSizes.enums<A4>.say
camelia [0 0 595 842]
tbrowder__ m: my Array enum P << :A4[0,0,595,842]>>; say P.enums<A4> 18:14
camelia [0 0 595 842]
tbrowder__ excellent! thnx, guifa!
Nemokosch guifa: the trap is that most of the time it makes no sense for something that transforms a value to have lower precedence than the assignment 18:18
this is something I more often didn't want than wanted 18:19
Anton Antonov @guifa I think you should continue learning Bulgarian. 19:18
guifa Anton: not going to lie, if I did a Slavic language it'd probably be Bulgarian. No cases = equally 19:26
Anton: not going to lie, if I did a Slavic language it'd probably be Bulgarian. No cases = equally 19:27
Anton Antonov @guifa I think Bulgarian has three cases. Also, Bulgarian is classified as Slavic because of the vocabulary, but it is an analytic language -- very different from the rest of the Slavic languages. (They are synthetic.) 19:32
@guifa My advice to you above is more of a reminder for me to go back learning Portuguese. 19:33
[Coke] knows only diado koleda from the little bulgarian he studied. (and also that it has a lot of loan words like ciao) 21:06
Anton Antonov LOL 🙂 🙂 21:07
Yes, Дядо Коледа !
[Coke] And I only know that because I also am a Coleda. :) 21:08
Anton Antonov Right -- I noticed that some time ago... (From your GitHub.) 21:10
@Coke Do you play sudoku often? Meaning, do you use Raku to help your sudoku playing? 21:14
[Coke] Yes, I follow "cracking the cryptic" and do a lot of the puzzles they present; often variants where you need to fill killer cages, etc. 21:15
(which is why that module)
Anton Antonov I see. I like doing Combinatorial Optimization (CO). So Sudoku puzzles can be solved doing CO. Now, in order to do CO with Raku a fair amount of module work has to be done. So, next best thing -- I think -- is to do Raku for CO, (instead of CO with Raku.) 21:19
So, I am curious, do you use some non-Raku math or "crypto" systems? 21:20
[Coke] no, I'm only using raku to do simple things like "if I have 4 distinct digits that need to add to 19, what could they be?" I'm not doing anything particularly mathy. 21:33
basically, letting the module do the annoying stuff so I can do the fun stuff?
Anton Antonov @Coke Yes, something like that. Using natural language, and/or some easy to write DSL. 22:54