🦋 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.
Xliff \o 05:28
Hello night owls... here's a question for you:
What's the best method to determine if the callable you are using is being run from a class?
moritz what do you mean? 05:41
code shouldn't care where it's being called from, that hurts composability 05:42
xinming nemokosch, Yea, with space, it'll work, So is |(<<blabla $bleble>>) What I mean is, I think we should make |<...> work as expected as |<<...>> , So things can be consistent. 05:43
|<...> work as expect, But |<<...>> doesn't cause inconsistency, Which make me feel strange.
Xliff moritz: It does if your use case cares about where the code is being run. 06:23
It has nothing to do with composability if the actions occur at runtime so I do not believe that is an issue.
moritz: So if you have an answer to my issue, I would appreciate if you could share it. :) 06:24
moritz Xliff: I still haven't fully understood the question. Do you want to know if the caller is a class body, at compile time? 06:39
Xliff No. If the caller is in a class body at RUN time. 06:40
moritz but the class body isn't executed at run time
class X { foo() } # foo is called at compile time, no? 06:41
Xliff No, but methods are. 07:09
So I want to know if a method is being called by another method or a sub.
So... so far I have this: callframe(0).code; 07:10
And if its a sub, callframe(0).code.package === GLOBAL
That's my progress in the time since I asked the question. And I think that's going to be it for me, tonight.
lizmat m: class X { say "foo" }
camelia foo
Xliff \o lizmat! 07:11
lizmat m: class X { say "foo" }; BEGIN "before"
camelia foo
lizmat m: class X { say "foo" }; BEGIN say "before"
camelia before
foo
lizmat m: class X { say "foo" }; INIT say "before"
camelia before
foo
lizmat the class body is run as part of the mainline, so *after* INIT
moritz ^^
m: say "running"; class X { say "foo" }; INIT say "before" 07:12
camelia before
running
foo
Xliff moritz: If you have anything further to add, just drop it with a "Xliff:" prefix or a .tell and I'll get it. Hopefully I'll write a blog post about what I am trying to do if I'm successful.
moritz ok, it turns out my mental model of raku is quite of sync with reality 07:14
Geth planet.raku.org: 39c6492600 | (Elizabeth Mattijsen)++ | perlanetrc
Hopefully finally fix feed of Anton and Steve
07:18
Geth planet.raku.org: d5fd3e7a1c | (Elizabeth Mattijsen)++ | perlanetrc
Perhaps wordpress URLs need a trailing slash?
07:22
lizmat ah, that was the trick 08:22
nemokosch xinming: a way to achieve consistency could be to ban |<...> as well, no joke 08:50
That would be easier to ban because it parses 08:51
RE: raku.org site - I replaced the "fetch blog posts" script with a Raku script, except for "xml_escape" which I'm not sure what it was about and maybe it's not even necessary 08:57
Previously I think the installation of dependencies was ad-hoc, this is definitely an infra question how the dependencies should be resolved 08:58
The whole thing could be turned into a distribution, of course 08:59
There is also a process.pl referenced that possibly doesn't even exist 09:00
lizmat and yet another Rakudo Weekly News hits the Net: rakudoweekly.blog/2023/08/07/2023-...doc-gamma/ 12:17
leont lizmat++ 12:26
vendethiel lizmat++ 15:46
librasteve I have been fed 15:49
tx xx 2! 15:52
xinming m: pastebin.com/fCA9kg21 18:55
camelia ===SORRY!=== Error while compiling <tmp>
Confused
at <tmp>:1
------> https:⏏//pastebin.com/fCA9kg21
expecting any of:
colon pair
xinming pastebin.com/fCA9kg21 <-- Hi, is it possible to remove the extra $channel-job-notifier in this script please? The script is running fine, I'm using it ATM. 18:56
But the extra $channel-job-notifier doesn't give me the feeling of "perfect" sollution. 18:57
So asking here for better solutions. 18:58
xinming It makes me unnatural, So I don't feel ok with the script, Even it is working fine for me. 18:58
xinming hmm, Ignore me, I just dig from my old codes, and found `my Semaphore $semaphore .= new(3)` 19:10
drakonis buttondown.email/hillelwayne/archi...-gremlins/ 20:51
i am not the author
rf Where does this person get gremlins from? Besides that I think they liked Raku? 20:59
drakonis en.wikipedia.org/wiki/Gremlin 21:01
coleman They are mischievous, magical critters 21:11
nemokosch Gremlins, as in the movie with the funny soundtrack? 21:16
> The documentation is really poor and the heavy reliance on symbols makes it hard to search for things oof 21:33
To be honest, I still think there are some mainstream languages that clearly have worse documentations: Typescript for sure and PHP can also be reasoned 21:34
and the Typescript documentation has the same problem as the Raku documentation, except like you don't even see the effort to define everything that exists in the language 21:35
On the other hand, if I think how much I learned from the documentation, compared to asking things on IRC, reading Github issues, experimenting with code and looking up Rakudo sources, weeell 21:36
especially since the search bar is, let's face it, downright broken 21:37
tonyo the biggest lift i can see is if the docs linked to the implementation in the source, a lot of times i read the docs and then end up having to grep the source for the implementation so i can figure out exactly how to use it the function 21:38
a tool like `go doc` would also be big (for me) but that audience is likely small 21:39
nemokosch I don't like this whole "edging" with the implementation-neutrality, it's getting really tiresome 21:42
the whole language versioning is very much subject to "we are not going to change anything that might be depended on, only horizontally extend Rakudo" attitude 21:43
but I guess if this narrative survived to this day, let's wait until RakuAST at least 21:44
anyway, even if it's announced tomorrow that Rakudo is the specs from now on, mapping concepts to their Rakudo source would be either always incomplete or a tremendous effort when done serously 21:46
antononcube I know how to get Gherkins with Raku. 22:40
tonyo what do you mean by edging with the implementation neutrality? 23:38