🦋 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.
tbrowder tony-o: got it, not much help on my end until after the holidays, sorry 00:43
tellable6 2020-12-19T08:38:46Z #raku <jmerelo> tbrowder let me check
2020-12-19T08:39:41Z #raku <jmerelo> tbrowder if it's about authorship of the articles, there's not much I can do. If it's some other thing, it got lost. Please use email...
Geth doc: JustThisGuyAZ++ created pull request #3748:
Update Path.pod6
02:36
melezhik .tell tony-o, I've uploaded fez plugin to SparrowHub - sparrowhub.io/plugin/raku-utils-fez/0.000002 , it happened to be number 200 in SparrowHub eco system, :-) 02:49
tellable6 melezhik, I'll pass your message to tony-o
melezhik .tell tony-o , I've updated, with more accurate example - sparrowhub.io/plugin/raku-utils-fez/0.000003 03:42
tellable6 melezhik, I'll pass your message to tony-o
tony-o 2 05:11
tellable6 2020-12-23T02:49:18Z #raku <melezhik> tony-o, I've uploaded fez plugin to SparrowHub - sparrowhub.io/plugin/raku-utils-fez/0.000002 , it happened to be number 200 in SparrowHub eco system, :-) 05:12
2020-12-23T03:42:57Z #raku <melezhik> tony-o , I've updated, with more accurate example - sparrowhub.io/plugin/raku-utils-fez/0.000003
Geth ecosystem: 52195f24aa | Coke++ | README.md
Minor cleanups

  * Use more serious tone up front
  * eliminate "temp" note. If we come up with a plan, we can then note it here.
  * more md formatting
  * less "META.info" references.
  * link to docs instead of design (which claims to be out of date)
06:33
ecosystem: 9b64d8a98f | (Juan Julián Merelo Guervós)++ (committed using GitHub Web editor) | README.md
Merge pull request #570 from coke/cleanup

Minor cleanups
jmerelo CFP for the FOSDEM devroom closes today! news.perlfoundation.org/post/fosde...for-papers 06:39
tellable6 2020-12-22T23:13:08Z #raku <tony-o> jmerelo fez is in the ecosystem now for install - included in it is a way to patch an existing zef config to use the p6c mirror & zef ecosystems
jmerelo .tell tony-o thanks!
tellable6 jmerelo, I'll pass your message to tony-o
coldpress so I see from docs.raku.org/language/nativecall#Structs that CStructs can have CPointers. How do I define a CStruct for a node of a linked list? 08:20
moon-child coldpress: class CIntList is repr('CStruct') { has int64 $.n; has CIntList $.next; } 08:23
iirc 08:24
coldpress m: use NativeCall; class CIntList is repr('CStruct') { has int64 $.n; has CIntList $.next; }; CIntList.new(n=>0, dest=>CIntList.new(n=>1)).say; CIntList.new(n=>0, dest=>CIntList.new(n=>1)).dest.say 08:25
camelia CIntList.new(n => 0, next => CIntList)
No such method 'dest' for invocant of type 'CIntList'. Did you mean
any of these: 'does', 'gist', 'list', 'List'?
in block <unit> at <tmp> line 1
coldpress m: use NativeCall; class CIntList is repr('CStruct') { has int64 $.n; has CIntList $.next; }; CIntList.new(n=>0, next=>CIntList.new(n=>1)).say; CIntList.new(n=>0, next=>CIntList.new(n=>1)).next.say 08:26
camelia assign requires a concrete object (got a CIntList type object instead)
in block <unit> at <tmp> line 1
coldpress moon-child: ^^
I'm trying has Pointer[CIntList] instead of has CIntList, and that doesn't seem to work either
moon-child you shouldn't need a pointer; has makes a pointer by default. (You need to use HAS to embed a structure by value) 08:27
maybe try the TWEAK trick from the page you linked?
coldpress wouldn't that create an infinitely big linked list? 08:28
also, I want to create a circular list; so I don't think I can use TWEAK here
moon-child sure, but you can make a private method that binds to 'next' privately 08:29
ix.io/2JeF/perl6 08:32
coldpress I see, thank you very much 08:33
kawaii what's the right way to string together these conditionals in the following statement? `if $content ~~ /^^@questions/ and $content ~~ / ?$$/ and rand < 0.01 { say 'yes' };`, `@questions` is an array of opening words i.e. `my @questions = 'can', 'when', 'should';` and `$content` is well, a question ending in `?`. :) 09:30
kawaii trying to check that the sentence starts with one of @questions and ends in ?, and then passes the 1% chance in the rand part 09:31
moritz you need to escape or quote that ? 09:50
and I would put the randomness test first, since it's the cheapest of all
kawaii moritz: ah of course, ? is a special character, thanks, missed that :) 09:53
and you're right, I'll do the rand check first
`if rand < 0.1 and $content ~~ /^^@questions/ and $content ~~ / '?'$$/ { say "a" };` 09:54
moritz for the checks to pass as written, it is enough if $content starts with one of the @questions on any line, and ends on a question mark on any other line 10:05
dunno if that's what you want, or if it even can contain multiple lines 10:06
jmerelo m: my $scalar-context = <1 2 3>; say "→ $_" for $scalar-context; say "→ $_" for $scalar-context<> 10:46
camelia → 1 2 3
→ 1
→ 2
→ 3
tib_ Hello, 11:10
jmerelo hi, tib!
tib_ from where comes all the files in ~/.raku/sources ?
hi jmerelo :)
jmerelo tib_: from rakubrew? Or rakudobrew?
tib_ hmm I don't installed any of it, but probably sparrow have installed it for me 11:11
jmerelo tib_: ah, OK, that's not it. Not really sure about sources, but the rest seems to be a precomp repo.
tib_ yep, it contains files like : AFED9027E812967FC8734CD341F7951801F8B86C 11:12
jmerelo tib_: right, that's the hashed name that's computed by the precomp engine 11:23
El_Che This may be interesting to people interested in growing Raku. Nothing new as such, but it's interesting seeing it all put together (fron GopherCon 2020): www.youtube.com/watch?v=uMqosPm7BP...mp;index=2 11:24
tib_ yes, seems all related to precomp, when I removed it everything was broken on my machine :P 11:34
thank you 11:35
El_Che personnaly I would remove the .zef dir 11:37
kawaii want ^ and $ not ^^/$$, thanks :) 13:13
ugh, ooops 13:14
[Coke] yawns. 13:59
leont Once again, hyper operator nodality bites me 14:06
I really with ».foo was equivalent to .map(*.foo), it's the think I most frequently want to do with it 14:07
SmokeMachine m: for (0 .. $*SCHEDULER.max_threads * 2) { start sleep 10; }; say "hi"; 16:02
camelia hi
melezhik .tell tyil. Hi Patrick! Could you please comment on this? github.com/melezhik/sparky/pull/2#...-750376484 , thanks 16:37
tellable6 melezhik, I cannot recognize this command. See wiki for some examples: github.com/Raku/whateverable/wiki/Tellable
melezhik .tell tyil Hi Patrick! Could you please comment on this? github.com/melezhik/sparky/pull/2#...-750376484 , thanks
tellable6 melezhik, I'll pass your message to tyil
tony-o ^H^H^H^H^H^H^H^H^H^H^H~ 16:39
tellable6 2020-12-23T06:39:32Z #raku <jmerelo> tony-o thanks!
patrickb o/ tony-o 16:40
tellable6 2020-12-22T23:14:31Z #raku <tony-o> patrickb fez is in the ecosystem now for install - included in it is a way to patch an existing zef config to use the p6c mirror & zef ecosystems
tony-o hey patrickb 16:41
just responded to your emails - 16:42
i'd like to see your list of stuff todo, and i renamed the repos in the monkey patch for zef
patrickb Do you plan to keep fez dependency free? 16:43
modules.raku.org/dist/Terminal::Ge...an:TITSUKI could be the simple solution for the password problem. 16:44
tadzik hah, fez, what a fantastic name
tony-o patrickb: yea, no dependencies for fez. i have some code using the libs in that repo ^ but no way to test windows 16:45
patrickb In german we say "Dies oder das fetzt" roughly translating to "This or that rocks" 16:46
I have access to a Windows, so can do some testing / development there. 16:47
tony-o: I'll type together a list.
tony-o patrickb: thanks, i'll send you a gist to test out win pass 16:49
patrickb reboots to linux
tony-o patrickb: github.com/tony-o/raku-fez/tree/winpass <- this *should* be okay to be built with zef 17:04
patrickb will give it a try (soonish, still have some other things to do first) 17:07
patrickb tony-o: Hm. Or I rewrite it to get rid of the native code. Requiring a compiler to build is suboptimal. That module I linked found a way around. I'll probably just copy that approach. 17:10
tony-o doesn't msvct come as part of a compiler? 17:11
msvcrt*
ahh, guess it comes as part of the visual studio run time and not just vs 17:12
patrickb I think it can be installed standalone as well...
tony-o i see that as well 17:14
patrickb I'll see what I can do. There has to be some way without requiring a compiler or install a library 17:20
have to leave... 17:24
tony-o gott speed 17:24
notagoodidea Hi, a weird question : What is the different using & or 17:43
tadzik & or what? :) 17:44
notagoodidea $ sigils for function declaration as in : my &foo = {...} and my $l = {...}
notagoodidea (Sorry enter key slipped :)) 17:44
tadzik ah :)
using &foo allows you to then call it as foo(), without the sigil, in practice 17:45
under the hood, I'm not sure :o
moritz the other thing is that & implies the Callable role 17:46
so you're giving the optimizer a type hint
notagoodidea With &, I also can use an infix function call but not with $.
moritz and the reader
notagoodidea There is one that stand out as a good practice? (Based on the use of sigils, I tend to favor & but I am pretty new at Raku) 17:47
moritz yes, using the sigils tends to be good idea 17:48
tony-o notagoodidea: use & if you're calling something Callable, use $ if you're intending use of a scalar 17:49
notagoodidea tony-o: So avoiding $ for quick pseudo-anonymous functions or do you take into account the "nature" of the results for the scalar part? 17:50
tony-o if it's a lambda it likely doesn't need a name, if it's a function ref then i'd use $ to pass it around 18:18
guifa2 .tell jmerelo when you get a chance, I'm finishing up my FOSDEM proposal, have a few Qs 19:47
tellable6 guifa2, I'll pass your message to jmerelo
tony-o .tell patrickb check out the winpass branch - should work in linux and windows now without a compiler 20:14
tellable6 tony-o, I'll pass your message to patrickb
[Coke] beats his head against Advent of Code Day 10 Part 2 some more. 21:38
tony-o [Coke]: what is p2? 21:51
patrickb tony-o: There is no gzip on windows and there is no easy substitute. It seems zef also found no solution to this. Ugh. 22:02
tellable6 2020-12-23T20:14:16Z #raku <tony-o> patrickb check out the winpass branch - should work in linux and windows now without a compiler
[Coke] each day is split into two parts, each worth one gold star: the 2nd part of day 10 is, given a path from 0 to X through N possible nodes, figure out how many different ways there are to get there. 22:03
\o/ Got there. Whew. 22:04
patrickb ugexe: Do I understand correctly, that zef can't install from cpan on Windows, because there is no gzip?
tellable6 patrickb, I'll pass your message to ugexe
patrickb timotimo: Thinking about how to best get fez (a new ecosystem client) to support gzip on windows. Could a pure raku implementation of gzip be performant enough? 22:08
timotimo no clue without trying it
notagoodidea [Coke]: Because of you, I am trying it but I am stuck in a stupid place. When I open the input file with "foobar".IO.lines, I got an array of string. How to convert it to Int ? 22:10
patrickb timotimo: Any gut feeling? (Yours is probably worth more than mine) 22:11
timotimo my gut tells me raku dists are usually pretty small, so unless it's catastrophically slow, it should be all right
MasterDuke notagoodidea: `.map(*.Int)` or `>>.Int`
[Coke] notagoodidea: "1.txt".IO.lines.map(+*) should work
but raku will also DTRT most o the time with "32" when you mean 32 22:12
m: say "32" == 32
camelia True
notagoodidea Yep when for sorting the data, raku don't as string can ordered it seems.
*be 22:14
patrickb Ha! There is no gzip, but there is a tar which can compressK
[Coke] you can tell sort to sort by a function 22:15
m: my @a = <100 1 10 102 110 9 8>; say @a.sort(+*);
camelia (1 8 9 10 100 102 110)
[Coke] so you can keep the originals as strings, sort them numerically... or convert them to numbers up front... (on one of the challenges, I stored them as keys in a hash which re-stringified them... so then I didn't bother making them numbers first...) 22:16
notagoodidea Ah. I made it work based on the documentation with @data.sort({$^a.fc > $^b.fc}) but using the max method after gave me the wrong anwser as the data where not converted to an number.
timotimo why call .fc on it if it's supposed to be numbers? 22:17
notagoodidea a sad case of "blindly copying the documentation and it worked" 22:18
timotimo you should really replace the whole thing with .sort(+*) like coke said earlier 22:20
notagoodidea But when doing that the resulting elements are still string (after "ffo".IO.lines.sort(+*)) 22:22
MasterDuke that's just sorting them numerically, they're still strings
notagoodidea but doing "foo".IO.lines.map(+*).sort gives me the intended list
MasterDuke yeah, now you're converting to numbers first 22:23
patrickb .tell tony-o password reading seems to work on my machine. (Unless the server accepts empty passwords and the prompt just ignored all input or something similar went wrong).
tellable6 patrickb, I'll pass your message to tony-o
notagoodidea Ah ok, I began to understand that sorting is not a in-place operation or at least destruction (if it were the case, the casting due to the sorting will stay). 22:24
MasterDuke correct 22:27
[Coke] is there a method to check equality on arrays or must I compare by element (current cheat: .join them and str compare) 22:59
lizmat You mean: you have two arrays, and are equal positioned elements the same ? 23:00
[Coke] all elements. 23:01
right.
lizmat [Coke]: you know the number of elems is the same?
[Coke] Also: is it expected that a shaped array has extra "blanks" off the end when dd-ing?
lizmat: y
lizmat m: dd ?all((1,2,3) >>==<< (1,2,3)
camelia 5===SORRY!5=== Error while compiling <tmp>
Unable to parse expression in argument list; couldn't find final ')' (corresponding starter was at line 1)
at <tmp>:1
------> 3dd ?all((1,2,3) >>==<< (1,2,3)7⏏5<EOL>
lizmat m: dd ?all((1,2,3) >>==<< (1,2,3)) 23:02
camelia Bool::True
lizmat m: dd ?all((1,2,3) >>==<< (1,2,4))
camelia Bool::False
[Coke] m: my @a = Array.new(:shape(3,3)); @a[2;2] = '3'; dd @a;
camelia Array @a = [Any, Any, [Any, Any, "3"], Any, Any, Any, Any, Any, Any]
timotimo do not recommend assigning a shaped array like that 23:03
m: my @a = Array.new(:shape(3,3)); dd @a
camelia Array @a = [Any, Any, Any, Any, Any, Any, Any, Any, Any]
[Coke] ok, what's the right way?
timotimo m: my @a := Array.new(:shape(3,3)); dd @a
camelia Array element = Array.new(:shape(3, 3), [Any, Any, Any], [Any, Any, Any], [Any, Any, Any])
timotimo m: my @a[3;3]; dd @a 23:03
camelia Array element = Array.new(:shape(3, 3), [Any, Any, Any], [Any, Any, Any], [Any, Any, Any])
[Coke] Roger, trying the bind 23:04
... doh. had two arrays, only ONE was shaped, also.
lizmat sees [Coke] is in good hands, so feels free to goto sleep& 23:05
[Coke] ~~ 23:06
... ok, failing differently at least.
lizmat m: dd (1,2,3) eqv (1,2,3)
camelia Bool::True
lizmat m: dd (1,2,3) eqv (1,2,4)
camelia Bool::False
[Coke] timotimo: how to copy one shaped array into another @var ? 23:07
timotimo i think assigning a shaped array into a @var[3;3] with a matching shape will work?
[Coke] if I do "@old = @new" I get "must provided structured data", if I do "@old = @new" I get an error further along (digging into that one.) 23:09
it complains about the structure of that one, getting Index out of range. Is: 1, should be in 0..0 -- trying to index with 0;1 at that point on a thing with a shape of 97;97 - throwing in some .shape calls.. 23:11
[Coke] aha. 23:14
my @thing = stuff(@old) - if stuff returns a shaped array, also have to bind there or lose the shape.
timotimo++
notagoodidea [Coke]: Ah! p1 solved and p2 looks... not fun :D 23:19
MasterDuke doesn't eqv work for array comparison? 23:28
m: for (1, 2, 4), (1, 2), (1, 2, 3), (1, 2, 4, 5) { say (1, 2, 4) eqv $_ } 23:30
camelia True
False
False
False
guifa2 Any examples of moduels that show off some seamless integration with Raku at an core / syntaxy level? 23:54
I'm thinking here of stuff like Cro (with its faux control blocks), Red (with its metamodels and traits) or my own DateTime::Timezones 23:55