🦋 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:01
reportable6 joined
00:15
NemokoschKiwi joined
|
|||
NemokoschKiwi | m: subset Nummie of Int where 1 .. 25; sub MAIN('run', Nummie :$test) { say 'RUNS.' }; @*ARGS = 'run'; | 00:16 | |
camelia | Use of uninitialized value of type Int in string context. Methods .^name, .raku, .gist, or .say can be used to stringify it to something meaningful. in block <unit> at <tmp> line 1 Use of uninitialized value of type Int in string context. Me… |
||
00:16
ProperNoun left
|
|||
NemokoschKiwi | subsets really don't play nicely with the CLI | 00:16 | |
m: sub MAIN('run', Int:$test) { say 'RUNS.' }; @*ARGS = 'run'; | 00:17 | ||
camelia | RUNS. | ||
NemokoschKiwi | Is there a way to make the subset accept omission the way Int allows it? | ||
00:57
TieUpYourCamel left
01:09
TieUpYourCamel joined
01:13
NemokoschKiwi left
|
|||
Nemokosch | github.com/rakudo/rakudo/issues/5079 somebody to close this? | 01:37 | |
02:13
evalable6 left,
linkable6 left
02:15
evalable6 joined,
linkable6 joined
02:22
jpn joined
02:27
jpn left
02:35
epony left,
cbk joined
02:50
razetime joined
|
|||
gfldex | m: subset Nummie of Int where 1 .. 25; sub MAIN('run', Nummie :$test = 1) { say 'RUNS.' }; @*ARGS = 'run'; | 03:02 | |
camelia | RUNS. | ||
03:13
derpydoo left
|
|||
Nemokosch | the idea was to allow omission of the argument | 03:19 | |
04:12
epony joined
04:54
Xliff left
04:58
jpn joined
|
|||
cbk | Is it possible for a Raku script to set an environment variable in the shell from which it was called. (I want the script to parse a file, look for certain key-value pairs, then do some magic like iterate over list of key-value pairs and do an export key=$value.) | 04:59 | |
05:03
jpn left
05:08
ToddAndMargo joined
05:18
ToddAndMargo left
|
|||
jaguart | You want your process to export into it's parent shell? Isn't that a classic-hard problem | 05:29 | |
cbk | yes | 05:30 | |
jaguart | stackoverflow.com/questions/263005...vironment. | 05:32 | |
it's a hard problem, kind of my design | |||
=~s/my/by/ | |||
cbk | I have a text document I want to take notes in. anytime the file is updated, I want Raku to read the file grab the key=value pairs then in a shell export | 05:33 | |
yeah its hard but thats why I use Raku? | |||
jaguart | no its hard because of the security architecture of shells | ||
doesnt matter which lang you use | |||
cbk | I may just have to write a Raku shell :( | 05:34 | |
jaguart | You can set the values into something like .bashrc-local and source that from within your parent shell | 05:35 | |
then you just set an alias to run your script and source the new values | |||
cbk | Cool, I'm looking at that now. So crazy it may just work. Thanks | 05:37 | |
jaguart | What are the updated ENV vars being used for? | ||
cbk | jaguart++ | ||
is '++" still a thing? | |||
jaguart feels a little increment of happiness | 05:38 | ||
cbk | Nice! | ||
05:38
cbk left
|
|||
jaguart | Can anyone point me to a working example of class-block trailing pod-declarator? My class-block trailing POD all seems to end up on the last attribute/method inside the class. Leading WHEREFORE works as expected. FWIW I'm using Module::Pod to spruik them. | 05:42 | |
as in: #| starts ok\n class Apple { method crunch() {...} }\n #= Apple ends. | 05:44 | ||
The Apple Ends.WHEREFORE is crunch() trailing. :( | |||
this is also odd: #| starts ok\n class Apple { method crunch() {...}\n #= last bite.\n }\n #= Apple ends. | 05:49 | ||
I get one Pod::Block::Declarator with 'last bite. Apple ends.' in trailing, WHEREFORE is crunch() --> :( | 05:50 | ||
06:00
reportable6 left
06:01
reportable6 joined
|
|||
CIAvash | jaguart: only this seems to work when class is not empty: `#| starts ok\n class Apple { \n #= Apple ends. method crunch() {...} }` | 06:23 | |
jaguart | oh interesting :) so trailing is just inside the beginning of the class declaration | 06:34 | |
07:01
linkable6 left,
evalable6 left
07:02
evalable6 joined,
linkable6 joined
07:30
razetime_ joined
08:00
jpn joined
08:09
jpn left
08:15
jpn joined
08:22
avuserow left
08:25
avuserow joined
08:26
jpn left
08:54
razetime_ left
09:07
Sgeo left
09:10
dakkar joined
10:02
mscha joined
|
|||
mscha | m: my @arr = (1,2,3),(4,5,6),(7,8,9),(10,11,12); say @arr[1^..*]; # works | 10:06 | |
camelia | ((7 8 9) (10 11 12)) | ||
mscha | m: my @arr = (1,2,3),(4,5,6),(7,8,9),(10,11,12); say @arr[1^..*;1]; # hangs | ||
camelia | (timeout) | 10:07 | |
mscha | Is this a bug or (not) a feature? | ||
Nemokosch | It doesn't seem appealing or reasonable, that's for sure. It might be just unimplemented; the question is if there is anything particularly different about it | 10:08 | |
10:10
lichtkind joined
|
|||
github.com/rakudo/rakudo/blob/2022...ce.pm6#L57 I think this is the call that backs it up | 10:11 | ||
10:30
Nemokosch joined
|
|||
Nemokosch | bisectable6: my @arr = (1,2,3),(4,5,6),(7,8,9),(10,11,12); say @arr[1^..*;1]; | 10:30 | |
bisectable6 | Nemokosch, Will bisect the whole range automagically because no endpoints were provided, hang tight | ||
tellable6 | 2022-12-05T16:03:03Z #raku <japhb> Nemokosch $*IN.lines tries to empty stdin all the way to EOF. So you're starving the REPL. | ||
2022-12-06T16:39:13Z #raku <SmokeMachine> Nemokosch: that's the smallestt problem IMHO... there are 2 posts for the same day... | |||
2022-12-07T16:32:01Z #raku <Xliff> Nemokosch: Apparently not in my code. a({ ... }) results in an error. | |||
hey Nemokosch, you have a message: gist.github.com/0c6124a1a06ebcd2c7...6b207ed115 | |||
Nemokosch | I really, really hope there is some timeout for something that hangs... | 10:32 | |
10:33
Nemokosch left
10:35
bisectable6 left
|
|||
Nemokosch | anyway, hoping that I didn't drive the bot into an infinite loop, mscha: I think I can see the problem | 10:37 | |
10:42
bisectable6 joined
|
|||
github.com/rakudo/rakudo/blob/63ea...ce.pm6#L10 this is exactly where the oversimplification lies | 10:47 | ||
11:28
hello19 joined
|
|||
hello19 | yo | 11:28 | |
does the container of an element in a shaped array know about its position in the array? and if so, how do I ask for it | 11:29 | ||
lizmat | it doesn't | 11:42 | |
El_Che | ... or does it? | 11:45 | |
(no it doesn't :) ) | |||
Nemokosch | What do you think would be a good place for surveys/polls for Raku users? | 11:55 | |
this Pair.freeze issue really made me think... how many people think Pair is a value type, or at least use it as if it were well-suited for that | 11:56 | ||
11:57
jpn joined
|
|||
sometimes I feel for myself that I blindly believe in using it simply because the funky-looking syntax and the name | 11:57 | ||
12:00
reportable6 left
12:01
jpn left
12:03
reportable6 joined
12:38
hello19 left
|
|||
for function return values... is there a separate `is rw` and `is raw` trait? Why is this docs.raku.org/type/Pair#method_value marked with `is rw` when the behavior is more like `is raw`? | 12:40 | ||
12:42
lichtkind_ joined
12:44
lichtkind left
|
|||
mscha | m: say $*RAKU.version, ' ', $*RAKU.compiler.version; | 13:08 | |
camelia | v6.d v2022.12.1.gd.52342.eb.0 | ||
13:39
frost joined
13:48
ProperNoun joined
13:54
frost left
|
|||
SmokeMachine | is there a way to `.wrap()`a accessor of an attribute? I'm playing with this idea glot.io/snippets/gg56bgwmhr, but I'd like to make it also work when calling accessors of a ìs rw` attribute... otherwise I'll probably have to insert a proxy there... | 14:17 | |
Nemokosch | m: use v6.e.PREVIEW; my @arr = (1,2,3),(4,5,6),(7,8,9),(10,11,12); say @arr[1^..*;1]; | 14:27 | |
oops | |||
I need to do this somewhere else | 14:28 | ||
14:29
xinming left
14:32
xinming joined
14:47
holyghost joined
14:54
holyghost left
15:09
Sgeo joined
|
|||
[Coke] | can I use RESOURCES without installation? I want to be able to refer to a config file anywhere in my checkout without having to worry about the path. (be nice if I could also refer to it when invoking a script that exists inside the checkout but I call the script from (e.g.) "C:\") | 15:20 | |
15:21
jo61 joined
15:22
jo61 left
|
|||
Geth | doc: 7e91a0018b | Coke++ | doc/Language/classtut.pod6 Fix categories. tbrowder++ |
15:28 | |
linkable6 | Link: docs.raku.org/language/classtut | ||
Nemokosch | github.com/codesections/advent-of-raku-2022 if y'all are interested - I actually tried to set a kind of example but frankly I'm not really doing the tasks | 15:44 | |
16:02
squashable6 left
16:04
NemokoschKiwi joined
16:05
squashable6 joined
16:06
NemokoschKiwi left
16:24
Kaiepi left
16:31
Kaiepi joined
17:00
jpn joined
17:05
jpn left
|
|||
[Coke] | looks like %?RESOURCES doesn't work with a non-installed version, yes? | 17:17 | |
(makes sense) | 17:18 | ||
ugexe | it works | 17:27 | |
zef uses %?RESOURCES, and can install itself | 17:28 | ||
17:30
dakkar left
|
|||
[Coke] | ... OH. I was missing a critical bit | 17:30 | |
(I didn't reference the module anywhere in my test script). OK, now I'm getting at least an interesting error | 17:35 | ||
I have raku-lib/path/foo.rakumod which is declared under the provides clause in the meta6.json, I have a resources file domains.json under resources/domains.json; if I use raku -I. something/other/script.raku with dd %?RESOURCES<domains.json>, I get Nil. | 17:41 | ||
(the script.raku uses the module declared under provides there.) | 17:43 | ||
nevermind, found your stack overflow answer to this very question | 17:45 | ||
ugexe++ | 17:47 | ||
Your previous patience in answering questions still paying dividends. :) | 17:48 | ||
18:00
reportable6 left
18:01
reportable6 joined
18:05
Guest58 joined
18:19
razetime left
19:19
evalable6 left,
linkable6 left,
unicodable6 left,
bloatable6 left,
statisfiable6 left,
quotable6 left,
squashable6 left,
nativecallable6 left,
coverable6 left,
shareable6 left,
benchable6 left,
reportable6 left,
greppable6 left,
sourceable6 left,
notable6 left,
releasable6 left,
tellable6 left
19:20
sourceable6 joined,
releasable6 joined,
evalable6 joined,
greppable6 joined
19:21
unicodable6 joined,
statisfiable6 joined,
bloatable6 joined,
tellable6 joined,
quotable6 joined,
benchable6 joined,
notable6 joined
19:22
coverable6 joined,
reportable6 joined,
shareable6 joined,
linkable6 joined
19:23
nativecallable6 joined,
squashable6 joined,
hello75 joined
|
|||
hello75 | i just asked gpt3 for "3 ways to write an infinite loop in raku". this is what it told me: www.paste.org/123566 | 19:24 | |
which is basically correct | |||
we all gonna be unemplyoyed in 10 years | 19:27 | ||
jast | this just replaces asking easy syntax question on Stack Overflow | ||
El_Che | I use copilot and you need to make sure it doesn't propose nice looking nonsense | ||
jast | ask it to implement something more uncommon, like a fast fourier transform, in raku | 19:28 | |
or fast inverse square | |||
... root | |||
or a golfed version of fizzbuzz :) | 19:30 | ||
hello75 | fizzbuzz | ||
controlc.com/429552ac | 19:34 | ||
FFR: it found the module by Joelle :D | 19:36 | ||
so it's picking stuff from the web, but it does a very good job at ot | |||
it | |||
lizmat | yeah, it's using superstitious parentheses in the "while (True) {' case, which is pretty Perlish | 19:39 | |
19:41
hello75 left
|
|||
jast | that's not golfed fizzbuzz though :) | 19:43 | |
20:41
evalable6 left,
linkable6 left
20:43
linkable6 joined
20:44
evalable6 joined
20:47
jpn joined
21:34
euandreh joined
21:51
mscha left
21:52
euandreh left
22:05
jpn left
22:06
jpn joined
22:19
jpn left
22:36
sftp left
22:37
sftp_ joined,
sftp_ is now known as sftp
23:02
mscha joined
|
|||
mscha | github.com/mscha/aoc/tree/master/aoc2022 | 23:03 | |
23:06
mscha left
|
|||
Nemokosch | you can also consider uploading some of it to github.com/codesections/advent-of-raku-2022 😛 | 23:23 | |
23:41
jpn joined
23:45
jpn left
23:48
lichtkind_ left
|