🦋 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.
guifa ugh so close to having my prolog interpreter going first step to getting logic into raku 01:03
SmokeMachine \o/ 01:04
I'm very curious about that! 01:05
guifa no fancy syntax yet 01:14
it's just a plain old simple prolog interpreter
so I can figure out some strategies of attack
I think in the end I'm going to use macro-esque reinterpreting of method calls 01:15
mother_child(X,Y) :- child_parent(Y,X), woman(X).
would be
logic mother_child(X,Y) { child_parent Y, X; woman X } 01:16
obviously, parentheses could still be used, just standard routine calls
each of the components of the predicate (separated by commas in prolog) would be separated by semicolons just like normal raku statements 01:17
Just like each prolog one gets interpreted more or less one by one (ish, depending on whether one does a depth or breadth first search, etc), I'll treat each statement similarly 01:18
the cool bit here will be that there's nothing preventing you from using Raku code there
plus(A, B, C) :- C is A + B. would be logic plus(A,B,C) { C == A + B }; # math done raku style 01:22
coleman Will this be a library or a deeper language extension? 01:28
SmokeMachine guifa: would it make sense to make `logic mother_child(:$X, :$Y) …` to make it possible to use any order? 01:32
guifa no, order is extremely important
SmokeMachine Even if parameters are named?
guifa yeah, because sometimes you can define the same thing in multiple ways and you'd want to potentially change the variable names accordingly, but the position is what's key 01:37
if I do
mother_child(X,Y) :- child_parent(Y,X), woman(X).
It will look up all the definitions of mother child, and see which don't conflict with mother_child(X,Y) (that's...all of them lol)
then it will check all versions of child_parent, check if any of them match the reverse pattern. then it will check that one is a woman. But the definition of child_parent might be 01:38
child_parent(K,P) :- birthed(P,K). child_parent(K,P) :- birthed(Px,K), married(Px,P) 01:40
SmokeMachine Ex: logic mother-child(:$X, :$Y) { child-parent :$X, :$Y; woman :$X }
guifa is X the mother or is Y the mother? 01:41
(remembering that there's no obligation to use X or Y, you could use M and C if X and Y make more sense elsewhere in the body) 01:42
SmokeMachine Depends on your definition… it could be: mother-child(:$mother, :$child) for example
And when defining: mother-child :mother<Maria>, :child<Jesus> 01:43
But feel free to ignore that… my knowledge on that is nullable… that’s just what I was thinking while reading about that… 01:44
guifa yeah. logic languages are.....different :)
SmokeMachine (But I still don’t see why it couldn’t be that way…) 01:45
The way I see, when storing it, you could just put on the right order… mother-child(X, Y) storing X, Y, and for mother-child(:$X, :$Y) storing $X, $Y… but I’ll stop insisting… I clearly don’t know what I’m talking about… :) 01:48
tbrowder .seen skaji 13:31
tellable6 tbrowder, I saw skaji 2021-10-22T01:56:00Z in #raku: <skaji> if you remove this line github.com/tbrowder/DateTime-US/bl...eral.t#L8, then the test will pass.
tbrowder @skaji's App::Mi6 is a wonderful and very useful tool, but he hasn't responded to issues or PRs in a while (although I see internal changes a few months ago). 13:40
lizmat, could you ping him to see if he is still interested in maintaining it? 13:42
else we could add it to community module collection 13:43
antononcube .seen leont 15:07
tellable6 antononcube, I saw leont 2024-03-03T22:58:39Z in #raku: <leont> I'd probably have to start with extracting a bunch of existing mi6 logic into its own modules so it's reusable (e.g. version handling)
leont ?
antononcube Hi, @leont ! 15:08
I want to parse YAML headers of placed in the beginnings of Markdown files. 15:09
This is in order to "parameterize" executable Markdown files. 15:10
leont «"parameterize" executable Markdown files»?
antononcube @leont Hm... sorry. That is from the so called Literate Progrmming (LP) perspective. 15:11
LP in Raku is facilitted with (1) Jupyter kernels, and (2) "Text::CodeProcessing".
The latter is used to "execute" Markdown, Pod6, and Org-mode files. 15:12
So, I want give parameters to those to files. RStudio's / Posit's Markdown files, with extension ".Rmd", use that approach. 15:13
Here is an example: monashdatafluency.github.io/r-rep-...eader.html 15:14
Here is another example: zsmith27.github.io/rmarkdown_crash...aders.html
@leont Sorry, if those messages above are too much... 15:15
I need an YAML parser and interpreters to get: (1) Raku hash of parameter name-value pairs, and (2) generate Markdown text/code. 15:16
leont So you preparse it to separate the two sections, and then use YAMLish for the first and a Markdown parser for the second? 15:19
antononcube Yes -- that is more or less I want to do. 15:21
From application of the YAML parser I get two results: a Raku hash, and Markdown text to be spliced with the rest of the Markdown file. The rest of the Markdown file is processed using the Raku hash -- the corresponding parameters are replaced with their values. 15:23
... Then the Markdown text is executed.
tonyo . 16:35
lizmat and yet another Rakudo Weekly News hits the Net: rakudoweekly.blog/2024/03/25/2024-...ing-again/ 18:23
antononcube @lizmat I shamelessly copied your meh-not-installed design from "App::Rak". (With reference.) 18:27
lizmat you're very much welcome :-) 18:28
antononcube 👍 18:32
tonyo .seen rf 19:41
tellable6 tonyo, I saw rf 2023-08-07T20:59:12Z in #raku: <rf> Where does this person get gremlins from? Besides that I think they liked Raku?
antononcube @tonyo Hmm... no @rf -- I was looking for them few days ago too. 22:09
tonyo getting weird body results on humming-bird, iirc they're still around though 23:13