🦋 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:16
guifa joined
|
|||
guifa | librasteve: the goal is to keep the definition of $y inside of the loop | 00:28 | |
this is me golfing something I saw in a larger code sample | |||
basically, the value for $y is lost | 00:29 | ||
wayland76 | .tell tbrowder Oh! That makes sense. Thanks :) | 00:37 | |
tellable6 | wayland76, I'll pass your message to tbrowder | ||
00:40
defaultxr left
|
|||
[Coke] | you can define the y as you invoke the loop | 00:40 | |
m: sub foo ($x) { loop (my $y = $x;;) { $y--; say $y; return 42 if $y < 0 } }; foo 4 | 00:42 | ||
camelia | 3 2 1 0 -1 |
||
[Coke] | m: sub foo ($x) { loop (my $y = $x;$y<0;$y--) { say $y;} return 42}; foo 4 | 00:44 | |
camelia | ===SORRY!=== Error while compiling <tmp> Whitespace required before < operator at <tmp>:1 ------> ;$y<0;$y--) { say $y;} return 42}; foo 4⏏<EOL> expecting any of: postfix |
00:45 | |
[Coke] | m: sub foo ($x) { loop (my $y = $x; $y < 0 ; $y--) { say $y;} return 42}; foo 4 | ||
camelia | ===SORRY!=== Error while compiling <tmp> Strange text after block (missing semicolon or comma?) at <tmp>:1 ------> p (my $y = $x; $y < 0 ; $y--) { say $y;}⏏ return 42}; foo 4 |
||
00:45
jpn joined
|
|||
[Coke] | m: sub foo ($x) { loop (my $y = $x; $y >= 0 ; $y--) { say $y} return 42}; foo 4 | 00:46 | |
camelia | ===SORRY!=== Error while compiling <tmp> Strange text after block (missing semicolon or comma?) at <tmp>:1 ------> p (my $y = $x; $y >= 0 ; $y--) { say $y}⏏ return 42}; foo 4 |
||
[Coke] | m: sub foo ($x) { loop (my $y = $x; $y >= 0 ; $y--) { say $y}; return 42}; foo 4 #sorry | ||
camelia | 4 3 2 1 0 |
||
[Coke] | m: sub foo ($x) { loop (my $y = $x; $y >= 0 ; $y--) { say $y}; return 42}; say foo 4 #sorry | 00:48 | |
camelia | 4 3 2 1 0 42 |
||
[Coke] | and there's the return value | ||
ugexe | that doesn't technically keep it in the loop | ||
m: sub foo ($x) { loop (my $y = $x; $y >= 0 ; $y--) { }; say $y; return 42}; foo 4 | |||
camelia | -1 | ||
00:50
jpn left
|
|||
[Coke] | oops | 00:53 | |
even says so in the docs. apologies for the mislead | 00:54 | ||
ugexe++ | |||
guifa | again, I get that I can define it in other ways. I was trying to golf that the assignment is lost | 01:00 | |
m: while True { FIRST my $y = 3; say $y--; last if $y < 0 } | 01:01 | ||
camelia | 3 0 |
||
guifa | the assignment to 3 should stick around | 01:03 | |
and so the output should be 3, 2, 1, 0 | |||
wayland76 | m: while True { FIRST { my $y = 3; } say $y--; last if $y < 0 } | 01:05 | |
camelia | ===SORRY!=== Error while compiling <tmp> Strange text after block (missing semicolon or comma?) at <tmp>:1 ------> while True { FIRST { my $y = 3; }⏏ say $y--; last if $y < 0 } expecting any of: infix inf… |
||
tellable6 | 2024-07-19T13:55:08Z #raku <tbrowder> wayland i was referring to the last part of the name: use a kebab-case alias | ||
wayland76 | m: while True { FIRST { my $y = 3; }; say $y--; last if $y < 0 } | ||
camelia | ===SORRY!=== Error while compiling <tmp> Variable '$y' is not declared. Perhaps you forgot a 'sub' if this was intended to be part of a signature? at <tmp>:1 ------> while True { FIRST { my $y = 3; }; say ⏏$y--; last if $y < 0 }… |
||
wayland76 | m: while True { my $y FIRST { $y = 3; }; say $y--; last if $y < 0 } | 01:06 | |
camelia | ===SORRY!=== Error while compiling <tmp> Two terms in a row at <tmp>:1 ------> while True { my $y⏏ FIRST { $y = 3; }; say $y--; last if $y expecting any of: infix infix stopper statement end … |
||
wayland76 | m: while True { my $y; FIRST { $y = 3; }; say $y--; last if $y < 0 } | ||
camelia | 3 0 |
||
wayland76 | m: sub foo ($x) { loop { my $y; FIRST $y = $x; $y--; return 42 if $y < 0 } } | 01:07 | |
camelia | ( no output ) | ||
guifa | I guess maybe it would need to be state ? | ||
wayland76 | m: sub foo ($x) { my $y; loop { FIRST $y = $x; $y--; say $y; return 42 if $y < 0 } }; foo 4 | 01:09 | |
camelia | 3 2 1 0 -1 |
||
wayland76 | There we go. | ||
The question then is, should "my" declarations in a FIRST block be magically pushed up to an ancestor scope. | 01:10 | ||
guifa | The whole point of putting them inside the block is to show they're in that scope | 01:12 | |
bisectable: while True { FIRST my $y = 3; say $y--; last if $y < 0 } | 01:13 | ||
bisectable6 | guifa, Will bisect the whole range automagically because no endpoints were provided, hang tight | ||
guifa, Output on all releases: gist.github.com/32975a2d3f0e8587a9...04053c136c | 01:14 | ||
guifa, bisect log: gist.github.com/cc018f08c28dfc5b6e...e3b486d8f8 | |||
guifa, Output on all releases and bisected commits: gist.github.com/1e5937bfcd5828ea6b...bd309e0f44 | |||
01:15
kylese left,
hulk joined
01:28
jpn joined
|
|||
wayland76 | If I have an object in a variable, and I want to call the second match in the multiple dispatch queue, is there a way to do that? | 01:28 | |
gist.github.com/wayland/0aff53d9e8...56a64b59eb for an example of what I'm trying to do | 01:30 | ||
Oh, I think nextcallee might work. | 01:31 | ||
01:34
jpn left
01:43
derpydoo left
01:50
defaultxr joined
01:55
teatime left,
teatime joined
|
|||
antononcube | weekly: youtu.be/5qXgqqRZHow | 02:10 | |
notable6 | antononcube, Noted! (weekly) | ||
02:15
hulk left,
kylese joined
02:30
jpn joined,
kylese left
|
|||
wayland76 | In Pod6, is C<nextsame> supposed to work in tables? | 02:32 | |
02:33
kylese joined
02:34
jpn left
03:30
jpn joined
03:35
jpn left
03:41
skyesoss left
04:31
jpn joined
04:36
jpn left
05:32
jpn joined
05:40
jpn left
05:52
skyesoss joined
06:34
jpn joined,
Chanakan left
06:38
Chanakan joined,
jpn left
07:14
jpn joined
07:26
esh left
07:27
esh joined
07:29
sena_kun joined
07:35
wayland joined
07:36
wayland76 left
07:42
Chanakan left
07:47
Chanakan joined
08:03
skyesoss left
|
|||
ab5tract | Do we already have a Raku tutorial/ integration for htmx? Or have I found a next project? | 08:55 | |
htmx.org/essays/hypermedia-on-what...youd-like/ | |||
08:58
Sgeo left
09:17
jpn left
09:22
jpn joined
|
|||
lizmat | wayland: in old style tables in pod6, no | 09:46 | |
wayland: in rakudoc procedural tables, yes | |||
github.com/Raku/RakuDoc-GAMMA/blob..._3.rakudoc | 10:10 | ||
librasteve | ab5stract: i have just made a website using htmx (mainly by cloning the htmx.org source) … it feels like the best path for my needs, although I’m still not quite sure where I’ll end up with CSS (bootstrap too old? tailwind too much js / too disruptive of the separation of concerns?) | 10:46 | |
i was thinking that something like Elm HTML library in raku that would make Htmx would be perfect … happy to apply some tuits to that if you need | 10:47 | ||
wayland | lizmat: Regarding the RakuDoc thing, should I interpret that as "Not yet, but it's coming"? | 11:33 | |
lizmat | well, RakuDoc is very much a thing in RakuAST | ||
so with RAKUDO_RAKUAST=1 it should work | 11:34 | ||
wayland | OK. So if I submit a PR to the official Raku documentation, will it work? | ||
Specifically, my PR at github.com/Raku/doc/pull/4501 has a table -- if I convert to the procedural style, will that be useful or counter-productive? | 11:35 | ||
lizmat | almost: finanalyst is working on getting the doc site generated using RakuDoc, and *then* it will work :-) | ||
wayland | Oh, right! Cool. Well, I'll leave my PR as is for now then. | 11:36 | |
lizmat | it will be useful, but I don't need think it will be merged until finanalyst's work is live | ||
which should be soon | 11:37 | ||
as possibly before the 2024.07 release | |||
wayland | OK. I'm not that fussed. I half wrote it for myself anyway -- "Writing to learn" and all that. | ||
lizmat | ack :-) | ||
wayland | Anyway, I'm turning in, but enjoy the failing tests I PR'ed for Hash::Agnostic :p | 11:39 | |
lizmat | :-) | ||
11:39
tejr left
11:40
tejr joined
12:03
oodani left
12:04
oodani joined
12:20
jpn left
14:23
jpn joined
14:29
jpn left
14:32
derpydoo joined
14:59
ACfromTX left
15:14
ACfromTX joined
|
|||
ab5tract | librasteve: sounds cool! | 15:33 | |
antononcube | @ab5stract I wanted to understand "Hypermedia On Whatever you'd Like" but it is mostly filled with statements which I have to choose to believe or not. Well, I do not know that author and problem area, so, it those are just opinions. | 15:56 | |
@ab5stract Fortunately, I can refer to your opinion on this. So, what is your "belief" in that article? 50%? 80%? | 15:58 | ||
16:16
jpn joined
16:39
skyesoss joined,
jpn left
16:53
jpn joined
16:59
skyesoss1 joined
17:10
jpn left
17:57
Sgeo joined
18:14
jpn joined
18:25
jpn left
18:28
guifa left
18:47
jpn joined
|
|||
ab5tract | I believe it inasmuch as htmx can be coupled with Delphi.. so it seems that they’ve achieved their goal of decoupling htmx from $backends | 18:52 | |
18:52
jpn left
19:18
Sgeo left
19:24
Sgeo joined
19:46
Sgeo left
19:49
Sgeo joined
20:45
Sgeo left
21:02
sena_kun left
21:16
ACfromTX left
21:18
Sgeo joined
23:31
lizmat_ joined,
HobGoblin joined
23:32
patrickb_ joined
23:33
destroycomputers left,
bingos_ joined,
dmvrtx left,
cm left,
bingos left,
dmvrtx joined,
goblin left,
cm joined,
patrickb left,
patrickb_ is now known as patrickb,
ilogger2 left,
Altreus left
23:34
Altreus joined,
lizmat left,
dutchie left,
ilogger2 joined,
dutchie joined
23:35
destroycomputers joined
|