🦋 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:03 lizmat left
phogg Per docs.raku.org/language/phasers LAST runs at loop termination, but here it has run for a loop that never started. Looking in github.com/Raku/roast/tree/master/S04-phasers I don't see a test for LAST. Is it supposed to fire after every loop even if it was never entered? 00:14
01:11 Manifest0 left, antim0d3s joined 01:13 sdfgsdfg left
tonyo the loop terminates with zero iterations, that seems sane to me 01:38
jesusthefrog By that logic, shouldn't FIRST fire as well?
tonyo only if the block is entered, 01:40
the language around it does seem confusing, though 01:42
i'd suspect you're mixing it up with NEXT 01:43
01:45 acidsys joined
jesusthefrog FIRST is described as running when the loop is initialized 01:46
LAST when the loop terminates. 01:47
How does it terminate without being initialized?
They seem to match, like ENTER and LEAVE do, and PRE/POST, BEGIN/END.
tonyo FIRST/NEXT is the match 01:49
may be a bug, i dunno if that's a regression 01:50
02:35 kylese joined 02:37 hulk left 02:42 jgaz left
phogg FIRST/NEXT don't match, see 02:52
m: my @a; while (True) { ENTER { @a.push('enter'); }; LEAVE { @a.push('leave'); }; FIRST { @a.push('first'); }; LAST { @a.push('last'); }; NEXT { @a.push('next'); }; last; }; @a.say;
camelia [first enter leave last]
phogg first fires, but not next. No match.
I would expect LAST not to fire when the loop never iterates. If I squint I can see a reason why FIRST would also fire when the loop never iterates, but not LAST without FIRST. 02:53
Hence me wondering what the rationale is.
03:12 jpn joined 03:15 kylese left, kylese joined 03:17 jpn left 03:39 hudo joined 04:50 jpn joined 04:55 jpn left 06:11 hudo left 06:28 jpn joined 06:33 jpn left 07:17 abraxxa joined 07:41 george36 joined 07:43 george36 left 08:04 jpn joined 08:13 jpn left 08:15 jpn joined 08:20 jpn left 08:39 jpn joined 09:04 jpn left, jpn joined 09:07 Sgeo left 09:09 dakkar joined 09:16 Manifest0 joined 09:17 sena_kun joined
librasteve lizmat made a nice post on phasers here dev.to/lizmat/phasers-part-2-of-2-2o5e 09:22
09:25 lizmat joined
there is a loop phaser example at the bottom - to my mind(?!) this is the desired behaviour (something like "output headers, output one line per iteration and then output footers") ... suggest anything different as a requirement could be added to the raku problem solving issues for wider consideration 09:27
I did run lizmat's for loop zero times (eg via given 42 {...}) and the output was (intentionally) blank ... so it doesn't look to me that <FIRST NEXT LAST>.any fires if the block does not loop at least once 09:29
lizmat in 09:31
indeed
m: for () { .say }
camelia ( no output )
lizmat m: for 42 { .say } 09:32
camelia 42
lizmat m: for () { LAST .say }
camelia ( no output )
lizmat m: for 42 { LAST .say }
camelia 42
hudo__ lizmat, thx for the hint. I'll give it a try, although I prefer "small" editors. This is a big piece of software.... 09:58
10:51 rypervenche left
phogg from that it sounds like 'for ()'is "loop never initialized" but 'while (False) ' is "loop was initialized" somehow, even though both lead to the loop body not running 11:07
m: while (False) { LAST 'last'.say; 'tick'.say }
camelia last
phogg I see it, I just don't understand why 11:08
lizmat hmmm interesting :-) 11:09
m: while 0 { LAST .say } 11:10
camelia No such method 'say' for invocant of type 'VMNull'. Found 'say' on
type 'Mu'
in block <unit> at <tmp> line 1
lizmat hmmm looks like a small can of LTAs here :-)
care to make an issue for it ? 11:11
phogg lizmat: you were offline for my original question, which is "why does LAST fire in this case?" There is no test coverage for it. I thought FIRST/LAST would have symmetry, but they don't.
from a plain reading of the docs it looks like it shouldn't
yeah, I'll file a ticket (after work, I am late right now) 11:12
lizmat agree that there shouldn't be a difference
phogg: thanks!
11:13 mscha joined
mscha m: say 7¹/₃ 11:13
camelia 2.333333
mscha m: say 3¹/₇
camelia 0.428571
lizmat m: Q|say 7¹/₃|.AST.EVAL 11:14
camelia 7.333333
lizmat m: Q|say 3¹/₇|.AST.EVAL
camelia 3.142857
lizmat
.oO( fixed in RakuAST )
mscha “Elizabeth Mattijsen changed the .raku representation of Rats (that cannot be represented decimally) from <22/3> to 7¹/₃.” 11:15
So only in RakuAST, I assume?
lizmat that was under "In RakuAST developments this week:" so yes :-)
mscha 😖
m: Q|say 7⅓|.AST.EVAL 11:16
camelia 7.333333
lizmat m: Q|say 7¹/₃.raku|.AST.EVAL 11:18
camelia <22/3>
lizmat m: Q|use v6.*; say 7¹/₃.raku|.AST.EVAL
camelia <22/3>
lizmat hmmmm
m: Q|dd 7⅓|.AST.EVAL 11:20
camelia <22/3>
lizmat feels like an artefact of .AST 11:21
mscha: sorry, but not going into the legacy grammar to fix that, hope you understand 11:22
mscha lizmat: of course, I just missed the header.
Is there a timeline for RakuAST / 6.e to become the “current” version? 11:23
lizmat as soon as possible ?
mscha :-)
lizmat more hands on RakuAST development would help that
11:26 buffet2 left 11:43 abraxxa left 11:56 abraxxa joined 12:12 antim0d3s left 12:13 teatwo joined 12:16 teatime left, allth_78613 left 12:23 mscha left 12:38 dano left 12:54 dano joined, dano left 12:55 dano joined 13:05 jpn left 13:06 sdfgsdfg joined 13:32 jpn joined 13:58 jpn left 14:05 jpn joined
[Coke] a better way to ask: what are the requirements for it to become current. Is it full RAKUAST support or is there more? 14:23
tellable6 2024-01-23T18:26:07Z #raku-dev <finanalyst> [Coke] would you please look again at PR 339 in doc-website. I've added more explanation about PR
antononcube I am interested to hear from Geo-computation enthusiasts. (There is at least one who made packages about Well Known Text.) 14:30
What kind of geographical data you are most interested in? (I personally, 90% of the time use city data, and related population and geo-coordinates.) 14:31
14:56 dano left 15:07 dano joined 15:39 sdfgsdfg left 16:06 sdfgsdfg joined 16:16 hudo joined 17:07 notna joined 17:11 notna left 17:12 notna joined 17:18 dano left 17:37 dakkar left 17:44 abraxxa left 18:16 dano joined 19:03 notna left
ugexe In so much as I work at a company that provides geolocation services 19:13
[Coke] last time I cared about it, was doing java consulting for the NYS DOT 19:15
back then it was internally housed info about all state roads, and then also political boundaries (city/town/etc.) 19:21
19:27 justache left 19:28 justache joined 19:42 justache left 19:49 justache joined 21:13 jpn left 21:35 Brian44 joined
phogg Political boundaries are useful. Population figures, too. Besides data stuff like those I've needed geospatial intersect and ellipse parameterization, but that's about all I've touched. 21:54
21:58 epony joined 22:03 jpn joined 22:08 jpn left
phogg lizmat: as I was composing the issue I thought of a rationalization for the difference in loop LAST behavior. 22:31
both while and loop fire LAST, for does not. With for there is an empty list, so there is no loop--and, from a certain POV, no test.
But while () is just sugar for while (False), and for (;False;) requires the False. This is a test, so you *could* say that "the condition was met" once. 22:32
Still seems wrong to fire LAST without FIRST so I opened the issue anyway, but it's at least a documentation bug.
s/'s at least/ may be only/ 22:33
22:38 Brian44 left 22:39 jpn joined 23:16 jpn left 23:45 sena_kun left 23:48 thowe left, Sgeo joined 23:49 gfldex_ is now known as gfldex