🦋 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.
mykhal gfldex: timtowdi, howewer requirement was rather to avid variables, than to have "this" 06:21
mykhal .. s/avid/avoid/ 06:26
nahita hi! i wonder why `+flat $(12, 84)` gives 2 but not 1... 08:11
m: say +flat $(12, 84); 08:12
camelia 2
nahita m: .say for flat $(12, 84) 08:13
camelia 12
84
mykhal nahita: hi. i wonder why would you expect 1. List in numeric context gives its length 08:50
nahita I expected it not to be flattened since it's itemized and therefore gave 1. 08:56
m: .say for flat ($(12, 84),) 08:57
camelia (12 84)
nahita `flat` respects it when in a list but why not above? 08:58
mykhal i probably miss something 09:01
m: say $(12, 84).elems
camelia 2
nahita m: .say for $(12, 84) 09:02
camelia (12 84)
nahita m: .say for ($(12, 84),) 09:04
camelia (12 84)
mykhal so you see 09:05
nahita no :)
mykhal m: say ((1, 2), 3).flat
camelia (1 2 3)
mykhal m: say ($(1, 2), 3).flat 09:07
camelia ((1 2) 3)
mykhal interesting. 09:08
m: say $(1, 2).^name eq (1, 2).^name
camelia True
mykhal well, ok, it's somewhat more complicated than i thoughtd, will comment no more :) 09:09
mykhal .. only that i think its meant not to flatten being item, not a whole "container" 09:15
m: say ( +flat( [1, 2] ), +flat( [[1, 2], 3] ) ) 09:19
camelia (2 2)
nahita not sure I follow *"its meant not to flatten being item, not a whole "container"*; can you please elaborate? 09:33
mykhal "When you have a list that contains sub-lists, but you only want one flat list, you may flatten the list to produce a sequence of values as if all parentheses were removed. This works no matter how many levels deep the parentheses are nested.", from docs. It's talking about sub-lists 09:35
nahita I see; but itemized sublists are immune to flattening, right? But behaviour seems to change when passed directly to `flat` as `flat $(12, 84)` and I'm unable to see why... 09:39
mykhal it does not treat the same the outer list-ish, "Interprets the invocant as a list, flattens non-containerized Iterables into a flat list, and returns that list." 09:54
i wouldn't like/expect flatteing [[1, 2], 3] to ( [[1, 2], 3], ) 09:55
but frankly i initially wouldn't expect different treatment of innter list vs arrays as well :) 09:59
nahita So it first calls `.List` on the argument and then flattens? 10:12
(or `.list`; i don't know the difference) 10:13
mykhal nahita: something like that.. if it's an iterable, it iterates it, Iterable.pm6: method flat(Iterable:D:) { Seq.new(Rakudo::Iterator.Flat(self.iterator)) } 10:30
nahita Thx; I also reached that and Rakudo::Iterator.Flat has some nqp stuff that I don't understand. What confuses me is: 10:32
m: .say for $(12, 84)
camelia (12 84)
nahita iterates once...
mykhal i can see 2 elems 10:33
lizmat but they're in a container :-)
m: .say for (12,84)
camelia 12
84
lizmat m: .say for $(12,84)
camelia (12 84)
lizmat well, I should say, they're itemized
mykhal i thout we were talking about the outer iterable 10:34
these items ate treated different weay than the original iterable 10:36
mykhal did not notice lizmat speaking now 10:38
nahita I understand/expect `.say for $(12, 84)` to iterate once. What I don't understand/expect is why `.say for flat $(12, 84)` iterates twice but not once? How can `flat` flattens an itemized list?
lizmat that's the idea of flat ? 10:39
nahita But it respects when `$(12, 84)` is in a list
m: .say for ($(12, 84),) 10:40
camelia (12 84)
nahita m: .say for flat ($(12, 84),) 10:41
camelia (12 84)
mykhal m: say $(12, 84).raku; say ($(12, 84),).raku 10:43
camelia $(12, 84)
($(12, 84),)
mykhal crap 10:44
m: say $(12, 84).flat.raku; say ($(12, 84),).flat.raku
camelia (12, 84).Seq
($(12, 84),).Seq
mykhal consistent, if one does not expect flat to be classical recursive function 10:47
nahita it is recursive though, isn't it
mykhal yes, but starting in top of items, not the whole arg 10:49
.. but that is also misleading statement
mykhal it does recursively flatten the items, but flat is not flatten 11:10
and Raku is not Haskell :) 11:13
alex16 Uploaded file: uploads.kiwiirc.com/files/232a733b...-13-16.png 11:50
Help brother
MasterDuke alex16: it looks like whatever os your phone is running doesn't have the dev package for openssl. i don't know if there's a way to exclude packages and/or modules with rstar, but you could always just install rakudo by itself, then manually install zef + modules 11:55
alex79 Help me failed build 12:00
Uploaded file: uploads.kiwiirc.com/files/889fcc5d...pasted.txt
MasterDuke alex79: i'd suggest downloading rakudo.org/dl/rakudo/rakudo-2021.07.tar.gz instead of rakudo-star and trying that first
alex79 Android 6.0 aarch64
MasterDuke people have built rakudo on other aarch64 systems (e.g., rpi4), so it's likely possible 12:01
you'll probably need something like `apt install build-essentials` first (i don't know what the actual package name is) 12:02
alex79 what is the command to install it, I have extracted the file? 12:08
MasterDuke something like `perl Configure.pl --backends=moar --gen-moar --make-install` 12:09
you can add a `--prefix=path/to/somewhere` if you want to install it to a particular directory 12:10
alex79 fatal: not in a git directory 12:16
MasterDuke but it should still start building, right? 12:20
alex79 currently installing moarvm 12:23
alex79 MasterDuke currently installing moarvm 12:25
MasterDuke it'll probably take a while 12:26
alex79 Updating submodules .................................... warning: Cannot protect .git/config on this file system - do not store sensitive information here.
Uploaded file: uploads.kiwiirc.com/files/fc647552...pasted.txt 12:27
How?
Util alex79: Sanity check - Are you able to create+compile+run a C program in the directories where you are trying to build Rakudo? 12:31
Good example to try: rosettacode.org/wiki/Hello_world/Newbie#C
alex67 MasterDuke How? 12:46
alex80 someone help me how to install rakudo in termux i've been trying since morning looking for a solution 13:20
tonyo does your excellent termux have perl? 14:35
MasterDuke i was helping them a bit, i believe their latest problem is that where they were trying to build was mounted noexec 14:40
nahita mykhal: if it's already flat, `flat` doesn't flatten in effect yes. But `$(12, 84)` isn't flat on its own, right? And it also doesn't get flatten if it is an element of a list instead of directly supplying to `flat`. 15:50
s/isn't flat on its own/is flat on its own/ 16:05
mykhal tonyo: my termux (not sure if excellent) has perl 5.34. after installing perl. 16:58
tonyo what's the output of running the perl Configure.pl stuff in the readme? 17:01
Summer is doing /<$userinput>/; equiv to doing an eval on user input, in terms of potential damage? 19:46
gfldex m: my $input = '{ say "hello haxor!" }'; say 'ohai' ~~ /<$input>/; 19:48
camelia 5===SORRY!5=== Error while compiling /home/camelia/EVAL_0
Prohibited regex interpolation (use the MONKEY-SEE-NO-EVAL pragma to
override this error but only if you're VERY sure your data contains no
injection attacks).
at /home/camelia/EVAL…
gfldex Summer: not quite on its own
Summer thats fairly neato 19:49
Geth doc/py-nutshell-enumerate-patch: 1f990b6fed | (Trey Harris)++ (committed using GitHub Web editor) | doc/Language/py-nutshell.pod6
py-nutshell: Add how to enumerate in iteration

Resolves #3924.
Modified from suggestion in issue to include `kv()`’s other use case in maps, matching Python’s `dict.items()`.
20:41
doc: treyharris++ created pull request #3925:
py-nutshell: Add how to enumerate in iteration
20:42
japhb tbrowder: JSON::Hjson added as a decoder-only module to github.com/japhb/serializer-perf -- it's a lot slower than JSON::Fast at decoding the JSON subset of Hjson, but that's to be expected from JSON::Hjson's idiomatic Grammar-driven design; probably would be more fair to compare to JSON::Tiny than JSON::Fast. 23:22
(Where "a lot slower" was 5-30x slower on my particular JSON test cases.) 23:23
tbrowder japhb: thanks, and i'm not surprised. i do find it useful for config files. 23:26