🦋 Welcome to the former MAIN() IRC channel of the Raku Programming Language (raku.org). This channel has moved to Libera (irc.libera.chat #raku)
Set by lizmat on 23 May 2021.
elcaro tbrowder: It's still not clear what your doing without an example... you have a list of things that are numbers in various formats, and your trying to parse them to a Numeric type? 00:22
also, one limitation of the radix literal syntax is, well... that it requires a "literal". you can't do `:$base<$str>`. for when you need a variable base, there's `$str.parse-base($base)` 00:24
tbrowder i understand. i just need a list of numbers that are not pure strings but retain their number type even as a string. the <<>> do that for all formats it seem. 00:27
elcaro Could you use allomorphs? 00:37
m: say my $x = RatStr.new(:16<10.1>, '0x10.1'); say +$x 00:38
camelia 0x10.1
16.0625
rassoc that's what «...» is doing 00:55
"This style of quoting is like qqww, but with the added benefit of constructing allomorphs"
tbrowder cool 01:43
and i'm constructing the set of allomorphs into an array for test inputs manually, so the <<>> are exactly what i need for that. 01:46
Geth Raku-Steering-Council: szabgab++ created pull request #42:
link to web site
04:31
Raku-Steering-Council: szabgab++ created pull request #43:
list all the announcements
04:41
Geth Raku-Steering-Council/main: 4cdf55c717 | (Gabor Szabo)++ (committed using GitHub Web editor) | README.md
link to web site
06:09
Raku-Steering-Council/main: e594156663 | (Juan Julián Merelo Guervós)++ (committed using GitHub Web editor) | README.md
Merge pull request #42 from szabgab/patch-1

link to web site
lizmat and yet another Rakudo Weekly News hits the Net: rakudoweekly.blog/2021/07/05/2021-...essing-up/ 10:59
moritz lizmat++ 11:21
rassoc thanks a lot! 11:32
rassoc raiph states the following in one of those links: "In Raku, Int denotes what PLs like Swift mean by Int?. The rationale is that object types should incorporate type safety by default without requiring a blizzard of ?s." 12:15
how is that true? crystal, rust and swift enforce these null-checks at compile-time, don't they? How does raku come close to this? 12:16
moritz it doesn't 12:24
tbrowder howdy, rakoons 12:54
i just put up a short article on a proposed 'modf' routine for the raku core on the rakudo wiki. its link is in the list in the brief menu on the right side entitled 'Modf routine'. 12:57
i would appreciate critical reviews and changes to that. 12:58
i have successfully moved my ongoing implementation of that from the 6.c to the 6.e release side of the rakudo master branch, and i will be implementing the user interface as i describe on the wiki. 13:01
m6locks has anyone done SICP in raku? 13:07
something like this alumni.media.mit.edu/~tpminka/PLE/h...tream.html
tbrowder correction: the title on the wiki is "Modf proposal"
littlebenlittle[ m: '"this"' ~~ / <?before '"'> <?after '"'> .* / 16:51
camelia ( no output )
littlebenlittle[ * m: say '"this"' ~~ / <?before '"'> <?after '"'> .* / 16:52
m: say '"this"' ~~ / <?before '"'> <?after '"'> .* /
camelia Nil
littlebenlittle[ m: '"this"' ~~ / <?before '"'> <?after '"'> .* / 16:53
camelia ( no output )
littlebenlittle[ * m: say '"this"' ~~ / <?before '"'> <?after '"'> .* /
m: say '"this"' ~~ / <?before '"'> <?after '"'> .* /
camelia Nil
littlebenlittle[ How can I get zero width assertions to work together in order to match values delimited by quotes or braces? 16:54
moritz m: say '"this"' ~~ / <?after '"'> .*? <?before '"'>/
camelia 「this」
littlebenlittle[ The before there is actually matching an implicit "", right? Or does it operate on .* from the right? 16:57
Ah, no, before operates from the right. docs.raku.org/language/regexes#Loo...assertions 16:58
Thank you!
m: say '-this-' ~~ rx:r / <?after '-'> <-[-]>* <?before '-'> /; 17:21
camelia 「this」
littlebenlittle[ m: say '-this-' ~~ anon grammar { token TOP { <?after '-'> <-[-]>* <?before '-'> } };
camelia False
CIAvash m6locks: I don't know SICP. Can you be a little bit more specific. From the haskell examples, you can do these things: 17:37
m: my &mul_odd_squares = *.grep(* !%% 2).map(*²).reduce: &[×]; say mul_odd_squares [1..5] 17:38
camelia 225
CIAvash m: say [×] [1..5].grep(* !%% 2).map(*²)
camelia 225
CIAvash m: my &mul_odd_squares = &reduce.assuming(&[×]) ∘ &map.assuming(*²) ∘ &grep.assuming(* !%% 2); say mul_odd_squares [1..5]
camelia 225
CIAvash m: [1..5] ==> grep(* !%% 2) ==> map(*²) ==> reduce(&[×]) ==> say() 17:39
camelia 225
rassoc littlebenlittle[, not the most concise, but you can also extract in case things become more complicated: 17:58
m: grammar G { token TOP { '-' ~ '-' <foo> }; token foo { <-[-]>* }}; G.parse("-this-")<foo>.say
camelia 「this」
rassoc m: "-this-".match(/'-' $<foo>=.* '-'/)<foo>.say
camelia 「this」
rassoc or utilize make/made
m6locks CIAvash: SICP is a programming course (and a similarly titled book) held at MIT, it uses Scheme to teach basic programming concepts mitpress.mit.edu/sites/default/fil...index.html 18:20
but it has been a hobby of many to re-do the exercises in a language of choice 18:24
rassoc m6locks: do you have a repo with the full list of exercises? 18:28
CIAvash weekly: github.com/CIAvash/qutebrowser-userscripts 18:43
notable6 CIAvash, Noted! (weekly)
CIAvash weekly: www.ciavash.name/blog/2021/07/05/r...d-my-blog/
notable6 CIAvash, Noted! (weekly)
sjn lizmat++ # weekly raku news \o/ 18:52
m6locks rassoc: alas, no, but there's quite few related repos on github, this being one github.com/ivanjovanovic/sicp 19:21
+a
also here: mitpress.mit.edu/sites/default/fil...index.html 19:22