🦋 Welcome to Raku! raku.org/ | evalbot usage: 'p6: say 3;' or /msg camelia p6: ... | irclog: colabti.org/irclogger/irclogger_log/raku
Set by ChanServ on 14 October 2019.
randyl22 hi all. Ruby has a "delete_if" method on an array, that deletes all elements for which a block evaluates to true. 01:39
is there a way to do something similar in Raku?
My first thought is to grep for the inverse of the block and reassign to the array. 01:40
Grinnz i dont know about in raku, but there is a port of the perl way i'd suggest modules.raku.org/dist/List::UtilsB...ock--array
randyl22 I didn't know about that port. Thanks. 01:41
Geth doc: 0fc35e52a8 | Coke++ | lib/Pod/Cache.pm6
Revert "Add exclusive locking"

This reverts commit ea98b81ac21517a070b717243d6d2feb4ed668ac.
01:57
doc: b04494f45d | Coke++ | xt/pws/words.pws
Revert "Remove unneeded words"

This reverts commit 0ea63db5cc6a688463b2551578701ad7d556a00b.
looks like pod-cache was broken when this was tested. :(
doc: f8a4c476a3 | Coke++ | 2 files
More fixups

  (had a bad pod-cache earlier)
02:11
codesections «My first thought is to grep for the inverse of the block and reassign to the array.» Was there something you don't like about that approach? That's also my first thought 02:34
m: my @a = ^10; @a = @a.grep({!.is-prime}); say @a
camelia [0 1 4 6 8 9]
randyl22 codesections: no, nothing wrong with the approach. mostly just curious if I was missing anything. 03:05
lizmat m: constant &foo = &say; foo "Hello World"; # rypervenche is that what you mean? 09:49
camelia Hello World
JJMerelo Have you answered already this year's Raku user survey? docs.google.com/forms/d/e/1FAIpQLS...Q/viewform Won't take more than 5 minutes, promised. 09:51
tellable6 2020-08-25T11:11:38Z #raku <tbrowder> jjmerelo: still no joy on doc change :-(
2020-08-26T15:51:16Z #raku <tbrowder> jjmerelo i still can't see any update to the docs from 2+ weeks ago
JJMerelo .tell tbrowder my new laptop crashed yesterday, I'm using now my old laptop... But I made a deployment just yesterday. Can you please check? 09:52
tellable6 JJMerelo, I'll pass your message to tbrowder
JJMerelo .tell tbrowder I'll check specifically your changes, and see if something is wrong there...
tellable6 JJMerelo, I'll pass your message to tbrowder
JJMerelo .tell tbrowder Yep, it's there now. docs.raku.org/type/Signature#Type_constraints Sorry about the delay. 09:55
tellable6 JJMerelo, I'll pass your message to tbrowder
tbrowder i see it, JJMerelo, good job! 10:18
tellable6 2020-08-27T09:52:02Z #raku <JJMerelo> tbrowder my new laptop crashed yesterday, I'm using now my old laptop... But I made a deployment just yesterday. Can you please check?
2020-08-27T09:52:36Z #raku <JJMerelo> tbrowder I'll check specifically your changes, and see if something is wrong there...
2020-08-27T09:55:14Z #raku <JJMerelo> tbrowder Yep, it's there now. docs.raku.org/type/Signature#Type_constraints Sorry about the delay.
JJMerelo Thanks, tbrowder. Sorry for the delay. 10:42
tbrowder no prob, thnx. what happened to laptop. hardware failure? 10:44
JJMerelo tbrowder I think it's related to an upgrade of the Linux kernel clashing with UEFI. But really no idea until I take it to the shop. 10:51
tbrowder erg
JJMerelo ^I think^the good technician from my trusted shop told me^
tbrowder what os
JJMerelo It's simply stuck at boot, I can't even bring up the boot menu or the system boot 10:52
Ubuntu 20.04
tbrowder bummer, go debian!
JJMerelo :-) I should do that. You mean "stable", right?
tbrowder yes 10:55
i lovee 10:56
love the mate desktop
JJMerelo I generally use Gnome shell
But I guess that's available there too.
tbrowder i think mate is based on the older gnome before the millenials caught the mac craze 10:57
JJMerelo :-) 10:58
I've rarely used Debian... I started with Slackware, then Redhat, then Fedora, switched to Ubuntu when Fedora mangled the RAID devices I used. 10:59
But Ubuntu 18.04 already eliminated Perl for Python... So maybe I should go to Debian. 11:00
abraxxa uses Ubuntu with i3 11:07
codesections abraxxa: have you tried sway/what are your thoughts on it? If I used i3, I'd be really tempted to make the jump to wayland 12:02
abraxxa codesections: yes, works but the HiDPI scaling works less good than X11 with Xft.dpi set correctly 12:08
codesections Fair enough. I bet they'll get there. And the main dev seems like a good guy 12:09
abraxxa main pain point for me is that the indicator icons aren't clickable
codesections personally, I'm still waiting for a static WM on wayland before I switch
(because I'm weird like that :D) 12:10
abraxxa static WM?
codesections Yeah – one that doesn't dynamically resize windows. I think ratpoison was the first, I currently use StumpWM 12:11
abraxxa don't know those 12:12
i3 and sway doesn't do that as well until you tell it to do so
codesections I previously used bspwm, which can be static or dynamic
StumpWM is a lot of fun (if you're into that sort of thing) since it runs as a common lisp interpreter and is configurable in all the Emacs-like ways you might expect from that. Not as lightweight as some but, like I said, fun if you're weird in the specific ways I am 12:15
rypervenche lizmat: Oh! That worked! So much simpler than I thought. Is there a way to do something similar with a method as well? 12:45
abraxxa codesections: team vim here and I don't customize that neither
lizmat rypervenche: get the Method object you want, then .^add_method it with the new name 12:46
.^add_method($name, $method) I seem to recall 12:47
afk for a few hours&
codesections abraxxa: I can respect that – I used vim (and then neovim) for quite a while and now use emacs with vim bindings
abraxxa most of the time I use Atom anyways because I don't like menu-less editors because I can't remember 4k keyboard combinations 12:49
codesections Are you worried about Atom now that it's Microsoft's second electron-based text editor? 12:50
I don't have a personal interest, since I don't use either, but as an outsider it sure looks like they're prioritizing VSCode over Atom 12:51
abraxxa i tried VScode and don't know why people like it more than Atom 12:52
moritz
.oO( because it's not nuclear! ) </troll>
12:53
codesections Yeah, I don't really get it either (again, without much experience with either, though I've tried both out for a bit). They sure *do* seem to prefer VScode, though: triplebyte.com/blog/editor-report-...tudio-code 12:56
colomon_ hi all! just realized I have wandered myself into an awkward corner and wondered if anyone had a clever solution. 14:53
I’m porting one of my C++ code generators from Perl to Raku.
I was all excited that qq:to eliminates indentation as that will make my embedded C++ code look much better in the context of the Raku code. 14:54
BUT I’ve just realized that { is now a special character in a qq string, right?
escaping that everywhere will obviously uglify my embedded C++ code. 14:55
is there a sane way to specify a string which handles variable interpolation but not { interpolation? 14:56
jdv79 wouldn't that be something about how Q is used?
no idea though 14:57
colomon_ huh, maybe? never heard of Q before, but I’m looking now. 14:58
tobs colomon_: there is a very sane way docs.raku.org/language/quoting#Lit...strings:_Q
you can specify which interpolations to activate and which not and `{ … }` and `$var` are different types. 14:59
colomon_ jdv79++ tobs++ # currently reading
this seems perfect at first glance
colomon_ Seems like what I want is Q:s:a:h:b:to/END/ 15:05
bit verbose, but it works 15:07
moritz now make poetry with that :-)
colomon_ going to have to bind it to a keystroke or something. 15:11
Geth ¦ problem-solving: fecundf assigned to jnthn Issue Map parameterized vs as Hash parameterized github.com/Raku/problem-solving/issues/223 15:17
guifa I feel like I’ve asked this before, but is there any way for a trait to have effect on the interior of method/sub block? 15:18
something like
sub foo is bar { #`[implied ‘use Bar’] … } 15:19
moritz not directly, I think 15:20
tobs colomon_: that is almost qq. I'd expect you can use instead qq and forbid the two you don't want: 15:21
colomon_ what’s the forbidding sequence?
notation
tobs m: my $x = $*USER; say qq:!c:!f[Hello $x, today is { Date.today }.] 15:22
camelia Hello evalbot, today is { Date.today }.
colomon_ tobs++
guifa moritz: reason I ask is the new Test::Inline module I made based on codesections++ desire to bring testing inside of module files (for accessing private stuff) 15:23
github.com/alabamenhu/TestInline
It feels clunky specifying “use Test” for most of the test subs. 15:24
Actually… could a custom declarator work and import the symbols in from the main Test module? so instead of having to do “sub foo is test”, I could just have “test { … }” ? 15:26
moritz I'm not deep enough into the guts to be able to answer that question :-( 15:27
guifa Meh, probably having people say “use Test” isn’t a big deal. Most test subs will probably have more than the line or two that I use in my test files ha. 15:37
oh, also
weekly: github.com/alabamenhu/TestInline
notable6 guifa, Noted! (weekly)
billN1VUX does Raku have something beyond FatRat that extends deep precision to sqrt, exp, e, pi, which are intrinsically irrational ? 16:46
p6: exp(π*sqrt(163)) - (640320**3 + 744)
camelia WARNINGS for <tmp>:
Useless use of "-" in expression "exp(π*sqrt(163)) - (640320**3 + 744)" in sink context (line 1)
billN1VUX p6: say exp(π*sqrt(163)) - (640320**3 + 744)
camelia -480
billN1VUX The above expression is a famous false near-integer equality, but with limited precision, Raku is off by either 480 or 1024 (using e**() instead of exp()) rather than the expected 7e-12 . For most purposes this small a % error is fine but ... this near-integer can't be done with FatRat since sqrt and exp will promote to Num. 16:50
thundergnat billN1VUX: rosettacode.org/wiki/Ramanujan%27s...stant#Raku may be useful. (or not, who knows?) 17:19
billN1VUX thundergnat - thank you, that's headed in the same direction at least 17:27
Hmm, Rat::Precise is half way and the RosettaCode example does the other bits needed, nice. Thanks! 17:33
(The bonus continued fraction version is delightful, works with standard FatRat, but both slow and needing to look up or separately calculate the continued fraction versions of expressions :-D )
thundergnat Yeah, Rat::Precise is pretty nice, ( though I'm biased, as I wrote it../ :-) ) 17:34
billN1VUX :-D 17:46
tobs billN1VUX: one afternoon, I toyed around with at least getting radicals of Rats supported exactly via CGAL. Having an exact type for &exp and co. seems harder though. 17:55
It's a very rough proof of concept but you can take it and adapt it if you want github.com/taboege/raku-Real-Algebraic 17:56
billN1VUX right, an exact type for irrationals is of course impossible
billN1VUX (unless one includes implied infinite via continued fractions or other stream computation via promises or whatever) 17:58
tobs it's not impossible, it's just not a numerator/denominator pair
if the number is algebraic, as k-th roots are, you can work with its minimal polynomial instead 17:59
billN1VUX that's fine for algebraic irrationals :-D
tobs but it only goes so far, and stops short of &exp and &log
billN1VUX yep
transcendental constants and functions don't play nicely in a world where it's either Exact representation or hardware float Num. 18:06
tobs aha, so to Rakudo the above number is integral as far as it sees: $x - $x.Int == 0e0. On the other end, Mathematica can deduce that it is not an integer. 18:07
and with that I have no idea how to help. I just did some computational geometry once where algebraics were just enough :)
billN1VUX thundergnat are you responsible for the continued fraction Raku version of Ramanujan's constant too ? That's an elegant "exact" representation but not going to have nice automatic conversions ;-D 18:08
Well, a *confirmation* that a generic `bignum` arbitrary precision float isn't here for transcendentals is useful, thank you both 18:09
I'm trying to do more of my one-liner tests of concepts in raku, and hitting something it didn't seem to do was startling - you've confirmed i'm reading the doc right, at least :-D. 18:10
thundergnat billN1VUX: No, that was actually written / contributed by SqrtNegInf. He has some high precision routines stashed away in his github repository. Lets see.... Ah! github.com/SqrtNegInf/Rosettacode-...n-routines (Not mine, though I contributed to it) 18:11
billN1VUX heh, i like their nick :-D
Good stuff 18:12
(I should have thought to check if Ramanujan's Constant or Heegner was a Rosetta Code page ! It's the sort of geek manna that would be there of course :-D ) 18:14
Geth doc: 2803bc363e | (Daniel Sockwell)++ | 2 files
Add the `add` and `remove` BagHash methods

This commit adds method documentation for the `add` and `remove` methods on the `BagHash` class and adds narrative documentation and examples showing their use. It also adds "baghash's" to the spellcheck dictionary to prevent a test failure.
19:02
doc: 075ff0b018 | (Daniel Sockwell)++ | doc/Type/BagHash.pod6
Address nits from PR review
linkable6 Link: docs.raku.org/type/BagHash
doc: 2a52612c7c | (Daniel Sockwell)++ (committed using GitHub Web editor) | 2 files
Merge pull request #3587 from codesections-forks/bag-hash

Add the `add` and `remove` BagHash methods
eseyman does anyone know till what date we can fill out the Raku user survey? 19:22
codesections eseyman: I don't know, but the survey is _really_ short (if you're worried about not having time to get to it before it closes) 19:59
rypervenche lizmat: Hmm, that works, but I'll have to do so for each type, which I don't think will scale well. It also doesn't work for ".new". Might there be a place in the grammar that I could simply add an alternation? I've been looking in the rakudo and NQP source code, but haven't found anything that I can successfully copy and change for my slang. 20:10
Geth doc: codesections++ created pull request #3594:
Provide a length hint for aspell
20:22
lizmat rypervenche: developing slangs is something that is really at the bleeding edge 21:51
even more so right now, as probably we will need to have a look at all slang modules before RakuAST is merged 21:52