🦋 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.
Geth doc: Kaiepi++ created pull request #3305:
Add type smiley to the glossary
01:18
cpan-raku New module released to CPAN! Data::Record (0.1.3) by 03KAIEPI 02:23
Kaiepi ^ optimizations for lists 02:25
Xliff \o 05:29
tellable6 hey Xliff, you have a message: gist.github.com/26d07ddf84734621d8...689ff72c66
Xliff .tell japhb Ooh! Thanks. I'm snagging this! ;) 05:30
tellable6 Xliff, I'll pass your message to japhb
jdv79 m: {:foo({})}.duckmap(-> $_ where Str {}) 06:00
camelia Odd number of elements found where hash initializer expected:
Only saw: "foo"
in block <unit> at <tmp> line 1
jdv79 is that a bug or what is the problem there exactly?
also 06:01
m: {:foo({:a})}.duckmap(-> $_ where Str {})
camelia ( no output )
jdv79 ?...
Geth doc/master: 5 commits pushed by (Ben Davies)++, (Juan Julián Merelo Guervós)++ 06:24
Kaiepi .tell jmerelo, can you take a look at github.com/Raku/doc/pull/3301 and github.com/Raku/doc/pull/3279 ? 09:56
tellable6 Kaiepi, I'll pass your message to jmerelo
lgtaube dn.se 10:21
sorry, wrong window 10:22
cpan-raku New module released to CPAN! Interval (0.0.1) by 03ELIZABETH 12:24
lizmat jdv79's question yesterday inspired me: ^^ modules.raku.org/dist/Interval 12:30
chloekek I wrote a blog post about how I built the infrastructure for building Raku modules with Nix: foldr.nl/raku-nix.html 12:45
tadzik chloekek: nice :) 12:46
so what static site generator did you settle on? 12:47
lizmat weekly: Building Raku modules with Nix
notable6 lizmat, Noted! (weekly)
lizmat weekly: foldr.nl/raku-nix.html
notable6 lizmat, Noted! (weekly) 12:48
chloekek tadzik: 60 lines of Raku. 12:49
github.com/chloekek/website/blob/m...build.raku 12:50
It’s very barebones, doesn’t yet generate a home page or index or RSS feed.
chloekek I really like WordPress, in part because it supports comments, but I dislike hosting it. 12:53
Doc_Holliwould installs Folding@Home 13:09
poohman hello all, 13:51
m: my sub filtered(Int $a) returns Bool {if ($a%5) {return True;}};[0..25].grep(filtered)
camelia 5===SORRY!5=== Error while compiling <tmp>
Calling filtered() will never work with declared signature (Int $a --> Bool)
at <tmp>:1
------> 3{if ($a%5) {return True;}};[0..25].grep(7⏏5filtered)
poohman Can I use any function as a matcher for grep? 13:52
If yes, can any one help with an example
or should an &filtered be used 13:53
m: my sub filtered(Int $a) returns Bool {if ($a%5) {return True;}};[0..25].grep(&filtered)
camelia Type check failed for return value; expected Bool but got Slip (Empty)
in sub filtered at <tmp> line 1
in block <unit> at <tmp> line 1
poohman m: my sub filtered(Int $a) returns Bool {if ($a%5) {return Bool:True;}};[0..25].grep(&filtered) 13:54
camelia 5===SORRY!5=== Error while compiling <tmp>
Invalid type smiley ':True' used, only ':D', ':U' and ':_' are allowed
at <tmp>:1
------> 3eturns Bool {if ($a%5) {return Bool:True7⏏5;}};[0..25].grep(&filtered)
expecting any of:
poohman m: my sub filtered(Int $a) returns Bool {if ($a%5) {return 1;}};[0..25].grep(&filtered) 13:55
camelia Type check failed for return value; expected Bool but got Slip (Empty)
in sub filtered at <tmp> line 1
in block <unit> at <tmp> line 1
poohman m: my sub filtered(Int $a) returns Bool {if ($a%5) {return 1;}else{return 0;}};[0..25].grep(&filtered)
camelia Type check failed for return value; expected Bool but got Int (0)
in sub filtered at <tmp> line 1
in block <unit> at <tmp> line 1
poohman m: my sub filtered(Int $a) returns Bool {if ($a%5) {return True;}else{return False;}};[0..25].grep(&filtered) 13:56
camelia ( no output )
poohman m: my sub filtered(Int $a) returns Bool {if ($a%5) {return True;}else{return False;}};say [0..25].grep(&filtered)
camelia (1 2 3 4 6 7 8 9 11 12 13 14 16 17 18 19 21 22 23 24)
jnthn You can just write `so $a % 5` instead of the if/else 13:58
poohman m: my sub filtered(Int $a) returns Bool {so $a %% 5}};say [0..25].grep(&filtered) 14:00
camelia 5===SORRY!5=== Error while compiling <tmp>
Unexpected closing bracket
at <tmp>:1
------> 3ltered(Int $a) returns Bool {so $a %% 5}7⏏5};say [0..25].grep(&filtered)
poohman m: my sub filtered(Int $a) returns Bool {so $a %% 5};say [0..25].grep(&filtered)
camelia (0 5 10 15 20 25)
poohman Thanks Jonathan
rypervenche m: say 'biangbiang noodles'.uniparse 14:03
camelia Unrecognized character name [biangbiang noodles]
in block <unit> at <tmp> line 1
rypervenche Ah, Unicode 13.0 isn't fully in Rakudo yet :P 14:04
jdv79 lizmat: neat 14:08
m: {:foo({})}.duckmap(-> $_ where Str {}) 14:09
camelia Odd number of elements found where hash initializer expected:
Only saw: "foo"
in block <unit> at <tmp> line 1
jdv79 seems a bug, no?
MasterDuke m: {:foo({})}.duckmap(-> $_ {}) 14:14
camelia ( no output )
MasterDuke m: {:foo({})}.map(-> $_ where Str {})
camelia Constraint type check failed in binding to parameter '$_'; expected anonymous constraint to be met but got Pair (:foo(${}))
in block <unit> at <tmp> line 1
14:15
jnthn Hm, is duckmap one of the things that attempts to replicate structure? 14:19
Altreus Is there a value that means "undefine this, whatever the type?" 14:39
(academic question; they're ints so 0 is fine) 14:41
MasterDuke Nil 14:46
poohman [0..5].map(*.say) 14:51
evalable6 0
1
2
3
4
5
poohman [0..5].say 14:52
evalable6 [0 1 2 3 4 5]
poohman [0..5].map(*.say)
evalable6 0
1
2
3
4
5
Altreus o
poohman how can I write this to a file 14:53
Altreus m: my Int $x = 1; say $x; $x = Nil; say $x;
camelia 1
(Int)
Altreus :O
that's magic
I like this
poohman [0..5].map($fh.say(*)) 14:54
does not work
chloekek p6: my $fh = $*OUT; [0..5].map({ $fh.say($_) })
camelia 0
1
2
3
4
5
MasterDuke m: my Int $a is default(3) = 4; say $a; $a = Nil; say $a # Altreus 14:55
camelia 4
3
poohman chloekek:i thought I tried something similar
wait
MasterDuke Nil resets to default. the default default is the type object 14:56
poohman chloekek : It works I didnt have the braces
how do the braces help? 14:57
chloekek p6: my $fh = $*OUT; $fh.say($_) for [0..5]
camelia 0
1
2
3
4
5
chloekek [0..5]map($fh.say($_)) calls $fh.say with $_ as an argument, then passes the return value of say to map
[0..5].map({ $fh.say($_) }) passes a block to map
poohman chloekek: thanks 14:58
uzl[m] I wrote a blog about Raku containers (uzluisf.gitlab.io/posts/2020/04/03...ntainers/) as a way to get myself more accustomed with them. Any feedback is welcome. 15:21
poohman m: $a="2,633.43"; say $a.Numeric 15:41
camelia 5===SORRY!5=== Error while compiling <tmp>
Variable '$a' is not declared
at <tmp>:1
------> 3<BOL>7⏏5$a="2,633.43"; say $a.Numeric
poohman m:my $a="2,633.43"; say $a.Numeric
evalable6 (exit code 1) Cannot convert string to number: trailing characters after number in '032⏏04,633.43' (indicated by ⏏)
in block <unit> at /tmp/EE9rVRrmai line 1
poohman Is there any simple function to do this? or should I remove the comma 15:44
chloekek p6: my $a = '2,633.43'; say +S:g/,// given $a 15:46
camelia 5===SORRY!5=== Error while compiling <tmp>
Unrecognized regex metacharacter , (must be quoted to match literally)
at <tmp>:1
------> 3my $a = '2,633.43'; say +S:g/7⏏5,// given $a
chloekek p6: my $a = '2,633.43'; say +S:g/','// given $a
camelia 2633.43
chloekek Not aware of a function for this.
poohman chloekek: Thanks 15:47
uzl[m] m: my $a="2_633.43"; say $a.Numeric 15:49
camelia 2633.43
uzl[m] m: my $a= 2_633.43; say $a.Numeric 15:50
camelia 2633.43
MasterDuke modules.raku.org/dist/Intl::CLDR:g...tur.com%3E might be useful 15:53
cpan-raku New module released to CPAN! Data::Record (0.2.0) by 03KAIEPI 17:27
Kaiepi ^ adds typings for flat, repeated lists such as (1,'a',2,'b'...)!
wildtrees[m] how can I chain a {$_ + 2) as foo here 'c'.ord.foo.chr ? 18:45
chloekek p6: say 'c'.ord.succ.succ.chr 18:53
camelia e
chloekek p6: say 'c'.ord.map(* + 2).chr 18:55
camelia
[Coke] m: 'c'.ord.map(*+2)>>.chr.say 18:56
camelia (e)
[Coke] ... "ish"
chloekek p6: say 'c'.ords.map((* + 2).chr).join 18:57
camelia e
Geth doc/master: 4 commits pushed by (JJ Merelo)++ 19:03
patrickb ping tadzik 19:07
tellable6 2020-03-31T23:13:04Z #raku <rba> patrickb: Updated rakubrew.org to v9. (remind me that I have to automate it SOON.)
2020-04-03T02:38:01Z #raku-dev <vrurg> patrickb Would you pls have a look at R#3591? Not all nqp runners are exe files yet, as it turns out. :)
linkable6 R#3591 [open]: github.com/rakudo/rakudo/issues/3591 [JVM][Windows][build][severe] Rakudo JVM backend build broken on Windows
patrickb rba: Thanks!
wildtrees[m] so is there something like map to chain subroutines into a method call chain , that doesn't turn the result into a list? I think I remember seeing something before, but I forgot what it was 19:33
AlexDaniel` can't you just use parens? 19:35
AlexDaniel` m: say ‘c’.ord.&{$_ + 2}.chr 19:36
camelia e
AlexDaniel` you can do this too
wildtrees[m] p6: say 'c'.ord.({$_ + 2}).chr #like this? 19:36
camelia No such method 'CALL-ME' for invocant of type 'Int'
in block <unit> at <tmp> line 1
AlexDaniel` m: say ‘c’.ord.&(* + 2).chr
camelia e
AlexDaniel` no I mean like 19:37
m: m: say (‘c’.ord + 2).chr
camelia e
wildtrees[m] AlexDaniel: ok yea that &{} chaining seems to be what I am after 19:38
AlexDaniel` wildtrees: why do you need it? What are you trying to do? 19:44
wildtrees[m] p6: "hello".comb.map(*.ord.&{$_ + 2}.chr).join('') # <-- AlexDaniel , just playing around 20:06
camelia ( no output )
wildtrees[m] * p6: say "hello".comb.map(*.ord.&{$_ + 2}.chr).join('')
p6: say "hello".comb.map(*.ord.&{$_ + 2}.chr).join('') 20:07
camelia jgnnq
chloekek Would be nice to have a periodic table of operators for 6.d. 20:23
Would be nice to have a periodic table of operators for 6.d. 20:25
I think the latest one is from 2009.
It doesn’t even mention the radioactive isotopes, such as ⚛️++ 20:26
tbrowder m: my %h = a => 1; my $h = %h; say %h; say $h; 22:55
camelia {a => 1}
{a => 1}
tbrowder help: i'm doing essentally the same thing as above in my code but the hash isn't getting its value assigned to the $h. do i need to coerce or $h or something? 22:58
ok, i lied. i didn't use the correct syntax for Data::Dump. 23:03