00:00 TempIRCLogger left, tbrowder left, gfldex left, tbrowder joined, TempIRCLogger joined, gfldex joined 07:28 atroxaper joined
atroxaper Hello! is there a way to take an access to private attribute of an object from a method of its class? Like class A { has $!a is built; method plus(A:U: A $one, A $two) { A.new(a => $one!a + $two!a) } 07:33
09:04 dakkar joined 10:03 ssaint joined
ssaint When is Raku supporting mobile (android, ios, etc) development? 10:04
10:11 ssaint left 10:13 ssaint joined 10:30 ssaint left
SmokeMachine m: class Bla { has $!value is built; method !value { $!value }; method plus(::?CLASS:U: ::?CLASS:D $a, ::?CLASS:D $b) { ::?CLASS.new: :value($a!value + $b!value) } }; say Bla.plus: Bla.new(:29value), Bla.new: :13value # something like this, atroxaper ? 10:53
camelia Bla.new(value => 42)
atroxaper SmokeMachine: Yes. I've discovered it already - i can make a private method to retrieve a private value. I thought there should be some syntax construction to avoid an explicit method creation 10:56
11:39 TempIRCLogger left, TempIRCLogger joined 11:51 atroxaper left 12:06 TempIRCLogger left, TempIRCLogger joined 12:11 TempIRCLogger left, TempIRCLogger joined 12:12 TempIRCLogger left 12:13 TempIRCLogger joined 12:43 discord-raku-bot left, discord-raku-bot joined
shift-eleven I was looking through the docs, but I couldn't find a filter or where method that acts like C#'s `.Where()` method which takes a predicate and gets elements based off it, is there a method like that or is there an alternative way to do this? 14:50
Nemokosch it's `grep` 14:59
while C# was inspired by SQL, Perl and Raku were straight-up inspired by Unix tools 😄 15:00
by the way, it's often more comfortable to use `map` directly because you can return `Empty` from `map`, indicating that nothing should be returned corresponding to a certain element 15:01
shift-eleven ah, could you explain the usage of `map` and `Empty` a bit more? 15:03
Nemokosch m: dd (Empty, Empty, Empty) 15:05
Raku has <docs.raku.org/type/Slip>s 15:07
Empty is essentially ().Slip
so when in an array, it flattens into nothing
well, "array", whatever container actually, could be a list, could be a sequence
so you could implement a combo of map and grep just by using map 15:09
shift-eleven ah gotcha, thanks
ah gotcha, thanks!
Nemokosch so, let me take the halves of only even numbers for example 15:11
m: ```dd <2731 23 15 4 31 44 62 8374>.map({ $_ %% 2 ?? $_/2 !! Empty });```
okay, it ate the discord formatting -.- 15:12
m: ``` 15:13
dd <2731 23 15 4 31 44 62 8374>.map({ $_ %% 2 ?? $_/2 !! Empty });
```
_whatever, man_, here it is:
I guess I could have used _div_ instead of the slash
shift-eleven ah, makes sense, thanks!
Im really liking raku but not having a lot of resources is kinda hard
Nemokosch I feel you
shift-eleven in terms of learning the language
Nemokosch also don't get surprised if you push the language and find something strange that doesn't seem to be described properly 15:15
but well that happens when a rather small team is managing a fairly big and complex programming languag
but well that happens when a rather small team is managing a fairly big and complex programming language
shift-eleven true
Nemokosch yesterday we figured out that the experimental "is cached" feature works with multimethods now
shift-eleven raku is the epitome of what my favorite language would be, OOP mixed in with FP and a little bit of esoteric-ness
Nemokosch but it didn't work for several years
it didn't work with my 2021.08 version either xD
as of 2021.10, it seems to be fixed 😄 15:16
anyways, so far, in my own case, Raku seems like a scripting and prototyping heaven 15:20
watch out for the sigils and iterables though, they often work _very_ differently from pattern matching in other languages, be it Javascript or Python or Erlang 15:22
most notably, there is still a lot of structure flattening in the language 15:23
15:49 getimiskon joined
shift-eleven ah ok, I dont think thats gonna be much of an issue with my usecases, but handy to keep in mind 16:17
16:33 melezhik joined 16:46 melezhik left 17:34 dakkar left