🦋 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.
lucs Is there a more elegant way to write this?: (|('a'..'c'), |(1..3)).pick 02:38
ugexe arguably (flat "a".."c", 1..3).pick 02:40
(<a b c 1 2 3>).pick but i dont think thats quite what you meant 02:41
lucs Yeah, the real ranges are wider, but I like the 'flat' there.
Thanks. 02:42
This works too: flat("a".."c", 1..3).pick 02:43
And might as well go full functional: ("a".."c", 1..3).flat.pick 02:44
j2020 there we go. hello all. 03:30
mykhal m: (****2)(1..5) 05:47
camelia ( no output )
mykhal m: say (****2)(1..5)
camelia (1 4 9 16 25)
mykhal m: say (* * * * 2)(2, 3), (** ** 2)(2, 3) 05:52
camelia 12(4 9)
moon-child m: say (&[*].assuming(2)∘&reduce.assuming(&[*]))((2, 3)) 06:01
camelia 12
moon-child m: say (2, 3)».&(&[**].assuming(*,2))
camelia (4 9)
moon-child tacit ftw! 06:02
mykhal wtf too 06:05
moon-child the main wtf imo is that ∘ has lower precedence than function application 06:06
m: say &[+](2, 3); say &[+]((2, 3)); say &[+](slip((2, 3))); say &[+](|(2, 3)) 06:15
camelia 5
2
2
5
moon-child why doesn't that print 5 2 5 5?
mykhal did not digest it yet, i was just wondering if (****2) will always work as hyperwhatever squared rather than curried product, or it would depend on arguments 06:19
moon-child ****2 has three lexemes: **, **, and 2 06:20
lexing is 'greedy'; it always tries to consume as many characters as it can before continuing. So for instance, ***2 will always be ** * 2; not * ** 2 06:21
you can see something similar with +: x+++y will always mean (x++) + y. Even though you can space it out to make it be x + (++y), or even x + (+ (+y))
so (****2) will always have a hyperwhatever, never a regular whatever 06:22
CIAvash moon-child: `|` is not the same as slip when used for arguments. docs.raku.org/routine/%7C 06:23
moon-child ah, I see, thanks! 06:30
mykhal m: " # ANFSCD, cannot se have non-normalized unicode strings ? 06:36
camelia 5===SORRY!5=== Error while compiling <tmp>
Unable to parse expression in double quotes; couldn't find final '"' (corresponding starter was at line 1)
at <tmp>:1
------> 3se have non-normalized unicode strings ?7⏏5<EOL>
expecting …
mykhal m: say "\x300" eq "\x340" 06:36
camelia True 06:37
mykhal m: say "\x340".ords>>.base(16) 06:38
camelia (300)
japhb mykhal: Yes, but that's not a Str, that's one of the Uni types (such as the NFC NFKC NFD and NFKD normalization-specific types) 06:40
Str is always NFG (Normalization Form Grapheme)
moon-child mykhal: try utf8-c8 06:41
mykhal m: say Uni(0x300) eqv Uni(0x340) 06:45
camelia This representation (VMArray) does not support attribute storage (for type Uni)
in block <unit> at <tmp> line 1
mykhal japhb , moon-child : Uni is cool, but how to compare them ? 06:49
moon-child that feels wrong. There should be an infix:<cmp>(Uni, Uni) 06:53
mykhal for now, i can eqv .list's 06:54
mykhal m: say <<hello #`(freaking) world>> 07:33
camelia (hello world)
mykhal m: say $_([Mu, Any].map(*.^methods>>.gist)) for [&[(&)], &[(^)]] 12:39
camelia Set(ACCEPTS iterator)
Set(BIND-POS BUILDALL BUILD_LEAST_DERIVED Bool CREATE Capture Method+{is-nodal}.new Method+{is-pure}.new Numeric Real Str Stringy WHERE WHICH WHY ZEN-KEY bless cache can clone collate defined dispatch:<!> dispatch:<.*> dispatch…
mykhal .. strange that if i replace symmetric difference operator &[(^)] with separate difference and reversed one: &[(-)], &[R(-)] , the last two resulting sets are same 12:47
m: say $_(<a b>, <b c>) for [ &[(-)], &[R(-)] ] 12:50
camelia Set(a)
Set(c)
mykhal so problem is elsewhere 12:51
m: say $_(|[Mu, Any].map(*.^methods>>.gist.Set)) for [&[(-)], &[R(-)]] # ah, missing "|" 12:55
camelia Set(BUILDALL BUILD_LEAST_DERIVED Bool CREATE Capture Numeric Real Str Stringy WHERE WHICH WHY bless can clone defined dispatch:<!> dispatch:<.*> dispatch:<.+> dispatch:<.=> dispatch:<.?> dispatch:<::> dispatch:<hyper> dispatch:<var> does emit gist gis…
lucs 「▸ zef install Inline::Perl5 --exclude="perl"」 installs the module, instead of, when missing "--exclude…", getting 「…␤===> Failed to find dependencies: perl:from<native>␤Failed to resolve some missing dependencies (use e.g. --exclude="perl" to skip)」. And yes, it appears that no matter which Perl is currently being used, perlbrew'ed or otherwise, it's the Perl that was active when the module was installed that Raku will use. 13:02
Also, make sure that the version of the relevant Perl was built with the -Duseshrplib option.
[Coke], raydiak, moritz, ugexe: thanks for your help on this.
keutoi I am having a bit of trouble with multiline definitions in the repl. Can someone take a look? 15:42
imgur.com/a/Pi17pLg
mykhal (absent) keutoi : interesting, confirmed in 2021.06 and yesterday's master as well 18:09
MasterDuke El_Che, leont: any idea if lizmat's house is underwater 19:59
leont They're fine. They live near the river, but on higher ground 20:37
Some villages near them were evacuated, but I think everyone is back now 20:38
lizmat yeah, all fine here... :-) 23:03
all of the extensive water works of the past 25 years or so, worked out in our area of the river 23:04
the river grew from 50m wide to 1.5km wide, but it's all within expected parameters, more or less :-)
MasterDuke: thanks for the worries, though :-) 23:05
tellable6 lizmat, I'll pass your message to MasterDuke
raydiak \o/ 23:15