🦋 Welcome to the MAIN() IRC channel of the Raku Programming Language (raku.org). This channel is logged for the purpose of keeping a history about its development | evalbot usage: 'm: say 3;' or /msg camelia m: ... | Log inspection is getting closer to beta. If you're a beginner, you can also check out the #raku-beginner channel!
Set by lizmat on 25 August 2021.
mfiano Hi. Newbie here, trying to figure out some problem with the repl. 06:02
Works on 1 line, but not 2: i.lisp.cl/kpfZtk.png
elcaro The REPL doesn't play with some of the more dynamic features of Raku, particulary it doesn't work very well with new operators 06:07
unless it's all on one line, as you have found
mfiano Unfortunate 06:12
Thanks
moon-child m: say &[-](5) 07:02
camelia 5
moon-child should ^^ not be -5?
moon-child weirder is this 07:03
m: say <1 2 3>.map(&[-]); say <1 2 3>.map(&[~])
camelia (-1 3)
(1 2 3)
moon-child I understand each behaviour in isolation, but they seem inconsistent 07:04
gfldex m: say prefix:<->(5)
camelia -5
gfldex m: say infix:<->(5)
m: say infix:<->(5) 07:05
camelia 5
moon-child because: multi sub infix:<->($x = 0) { $x.Numeric }
gfldex &[-] defaults to infix by design 07:06
moon-child yes. The question is, why does infix - with one param not negate?
and given it does not, why does infix ~ with one param stringify?
gfldex Because, no matter the multicandidate, operators coerce and guarantee to return a specific type. 07:08
moon-child neither &infix:<->'s proto nor &infix:<~>'s guarantee a specific return type; so it is purely conventional 07:09
gfldex Roast demands them to. 07:10
moon-child that's fine, but I want to know why? 07:11
(also about the discrepancy between the map results)
gfldex Because Larry said so, basically. It is a fundamental design principle not to confuse humans with overloading the same operator over and over again. 07:12
If you see `~`, you know you gonna get a Str. 07:13
moon-child I mean, why does &[-](5) != -5?
gfldex Becaue [stuff] is a reduction operator and those are defined to take an infix as a function argument. 07:14
moon-child yes, the question is why does &infix:<-> not negate when called with one parameter?
gfldex Thus, even with higher order operator programming, you know what you gonna get. 07:15
CIAvash m: say &[~].candidates».arity; say &[-].candidates».arity 10:39
camelia (0 1 2 2 2 1 2 2 2 2 2 2 2 2 2 2 1 1 0)
(0 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2)
CIAvash I guess that's the reason for the discrepancy between the map results, `&[-]` doesn't have a candidate with arity 1 10:41
mfiano As a newbie I'm especially confused over why "[-] 42" is not -42 10:51
moritz_ m: say [-] 10, 2 10:52
camelia 8
mfiano Coming from a standardized language, it's hard for me to swallow "because the test suite mandates it" or "because Larry said so"
moritz_ why would [-] 42 be -42 but [-] 42, 0 be +42? 10:53
unary [-] is ambiguous, which is why it's not defined 10:54
mfiano How is it ambiguous? It is well defined in other languages, no?
moritz_ 12:53 < moritz_> why would [-] 42 be -42 but [-] 42, 0 be +42? 10:55
that's what I mean
mfiano I don't know what the latter even means 10:56
I am talking about unary
moritz_ but that's -42, not [-] 42
-42 is defined in raku
mfiano So you can't apply - to a single argument 10:57
moritz_ not if you use it as an infix operator, no
in -42, it's a prefix operator
mfiano how would you do so as a prefix operator without the literal -42?
mfiano say applying a variable only known at runtime to the - operator 10:58
moritz_ -$foo also uses the prefix operator 11:00
mfiano Ok, makes sense. 11:01
mfiano Sorry for the dumb questions. Coming from Lisp and this is all new to me. 11:02
moritz_ the infix operator is, by its nature, a binary operator -- it always stands between two terms
mfiano Thanks :)
moritz_ so if the operator is associative, it's easy to come up with a sensible degenerate case for just one argument
but both - and / are not associative (so a - (b - c) and (a - b) - c) are not the same), so such a reduction doesn't follow automatically 11:03
you're welcome
mfiano Makes sense 11:03
Kaiepi releasable6, status 11:13
releasable6 Kaiepi, Next release in ≈9 days and ≈7 hours. 4 blockers. Changelog for this release was not started yet
tellable6 hey Kaiepi, you have a message: gist.github.com/86d02c0af6b5712db5...14574ac780
releasable6 Kaiepi, Details: gist.github.com/76876f8e0ca0fdbbf9...127580d5e8
[Coke] had a run() that I was then doing a .decode('utf8-c8') on the output of. Using Proc::Async, I want to use "whenever $proc.stdout.lines" - (from doc examples) - is there a similar need to manually decode? 14:06
(getting a different error at the moment, so not made it this far..)
[Coke] someone pointed out 'enc' parameter. Reading the docs explains the function. Thanks. 14:19
[Coke] should I be able to start two Proc::Async and have a react block following with 2 whenevers, once for each to get the lines, one for each to start? when I do that, one of the two doesn't seem to get trigger. 14:26
ah, I'm an idiot. Thanks. :) 14:29
[Coke] (there was a done in both of the react blocks). If I wanted a single react block to handle both procs, not sure if/how I could do that. 14:31
I guess manually check for both on the done. 14:32
better. 14:36
melezhik . 15:12
melezhik I have added a "share via tweet" link to project reviews page on mybfio 15:16
for convenience who use twitter
tonyo [Coke]: raku.land/zef:tony-o/Event::Emitte...er-Process 15:53
err oops
melezhik another interesting use for mybfio - people could announce new versions releases of their modules, by just adding a comment to a project reviews page 15:58
as the system will pop a project up to the top of the list upon this comment
so that users would quickly share their opinions on the new version, you don't even have to go long way of creating a new post on any social media ... just a thought ... 16:00
colemanx An API would make that easier 16:27
that's tricky with OAuth services, though
melezhik eventually when/if I add oauth for twitter, it'd be even more easier to use "share via twitter" link, as a one is already authenticated in twitter ))) 16:32
melezhik I have made a short review of mybf.io is someone is interested - dev.to/melezhik/mybfio-platform-fo...spect-2eom 19:46
Petr very useful 19:53
i cant find something like this year ago )) 20:07
berber44 melezhik: very interesting. just be sure to add protection against spammers, otherwise they will flood your site with their advetisements and genuine reviews will be lost amidst their garbage 20:20
melezhik berber44 sure, thanks, I have already thought about ... however if spammers start get the site, this could be sort of sign of popularity , he-he, but yeah, fair point 20:27
Petr - thanks 20:28
berber44 a sort of defense right now, that only GH authenticated uses can do posts, so at least a spammer needs to have a GH account, so it could be tracked down ... 20:29
I also thought maybe I could add category "languages", add add Rakudo to, and then for every Rakudo release - a new release comment could be added , so that users can give feedback on new release ... anyway just a thought ... 20:31
Petr right idea 21:18
where Raku search libs in Windows? 21:19
[Coke] C libs or raku libs? 21:26
afk
Petr Sorry, Raku libs 21:28
and C )) 21:29
tbrowder .tell melezhik a selection by language would be useful (don't forget Perl) 22:53
tellable6 tbrowder, I'll pass your message to melezhik