🦋 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.
ToddAndMargo How do I erase an array (clear out all its entries)? 00:03
timotimo you can assign Empty to it 00:04
m: my @foo = 1, 2, 3, 4; dd @foo; @foo = Empty; dd @foo;
camelia Array @foo = [1, 2, 3, 4]
Array @foo = []
ToddAndMargo Thank you! I just found I can use Perl 5's method too: `@y = ();` 00:06
ToddAndMargo I like Empty better as it is more human readable. 00:08
bye bye 00:11
RaycatWhoDat Hmm. 00:33
Does `~` force the result of a subroutine into a Bool?
Belay that, I missed something silly. 00:36
cpan-raku New module released to CPAN! Term::Choose (1.6.7) by 03KUERBIS 04:45
cpan-raku New module released to CPAN! Gnome::N (0.17.7) by 03MARTIMM 11:44
cpan-raku New module released to CPAN! Gnome::N (0.17.7.1) by 03MARTIMM 11:52
RaycatWhoDat Is there a more concise way to do this? 14:32
lizmat ? 14:33
RaycatWhoDat gist.github.com/RayMPerry/6d3d300d...832428bba4
(Sorry, I was uploading it.)
lizmat you are aware that the Date class has an "is-leap-year" method on it ? 14:35
RaycatWhoDat This exercise wraps those classes and bails-out.
Can't use 'em for this.
lizmat sub IS-LEAP-YEAR(int $y --> Bool:D) {
$y %% 4 and not $y %% 100 or $y %% 400
}
is the logic in the Dateish role 14:36
RaycatWhoDat Huh. Yeah, that makes sense.
Dunno why I didn't think of that.
RaycatWhoDat Thanks! 14:37
lizmat yw !
Geth doc: gfldex++ created pull request #3424:
show that substition works in enum subsript syntax
14:47
Geth doc: 05813680e5 | (Wenzel P. P. Peppmeyer)++ (committed using GitHub Web editor) | doc/Language/typesystem.pod6
show that substition works in enum subsript syntax
15:16
doc: a1373da06a | (Juan Julián Merelo Guervós)++ (committed using GitHub Web editor) | doc/Language/typesystem.pod6
Merge pull request #3424 from gfldex/patch-14

show that substition works in enum subsript syntax
linkable6 Link: docs.raku.org/language/typesystem
gfldex I just started a blog post with a title. That's a first! I usually write the post and then stare for 20 minutes at the screen to find a title that works. :) 15:51
gfldex lolibloggedalittle: gfldex.wordpress.com/2020/05/24/th...ous-infix/ 16:47
lembark Oddity: V6.c of CU::Repository::Installation creates non-executable #! wrappers for *-j, *-js if the backends don't exist. 16:53
Q: Would it make more sense to check for .IO.e of the executable prior to writing the wrapper? 16:54
e.g., if rakudo-j doesn't exist then zef-j w/ #!/bin/env rakudo-j isn't going to get very far.
pastebin.com/TMayNbjN 16:55
sour m: for {a => [1, 2]}<a> -> $x { say $x } 17:13
camelia [1 2]
sour this is super weird
sour m: my @v = {a => [1, 2]}; say @v; 17:14
camelia [a => [1 2]]
sour m: my @v = {a => [1, 2]}<a>; say @v;
camelia [[1 2]]
MasterDuke m: for {a => [1, 2]}<a><> -> $x { say $x } 17:20
camelia 1
2
lizmat weekly: gfldex.wordpress.com/2020/05/24/th...ous-infix/ 17:23
notable6 lizmat, Noted! (weekly)
chloekek p6: say 「ミームな人」.lc; 17:33
camelia ミームな人
oneeggeach is there an article/example of someone using multiple versions/APIs of a module in the same Raku program? 18:40
I've heard a couple times that this is possible, read about it in the design docs 18:41
but I was wondering how common it was to use that Raku feature
lizmat oneeggeach: not that common yet, but production sites are using that feature afaik 19:02
oneeggeach cool -- It's similar to NPM modules for JavaScript, yes? Each module downloads its specified versions of dependencies, so you can end up with multiple module versions being used within a single project 20:07
unlike NPM, though, seems like Raku is more explicit by lexicially specifying which module version is used with `use Module:ver<1.0.0>` 20:08
lizmat right
oneeggeach awesome, thanks lizmat -- just trying to square my learning of Raku modules with my prior experience from Ruby and JavaScript :) 20:09
suman m: say map *.Str.chars, 'hello', 1, 22/7, 42, 'world'; 20:19
camelia (5 1 8 2 5)
suman m: say "22/7".Str.chars 20:20
camelia 4
suman m: say map *.Str.chars, 'hello', 1, 22/7, 42, 'world';
camelia (5 1 8 2 5)
suman Why is 8 ?
Isn't it 4? 20:21
m: say "22/7".Str.chars
camelia 4
lizmat m: say 22/7 # say calls .gist 20:31
camelia 3.142857
lizmat suman ^^
daxim moritz, re news.ycombinator.com/item?id=23080192 : it's imperfect, but not awfully so. if one is competent in Unicode matters, then IntlChar/IntlCollator do 70% of the job and the rest can be worked around manually/inefficiently. old.reddit.com/r/lolphp/comments/c...9/es9eg06/ 20:41
the biggest problem is the lack of separation between encoded and decoded character data, similar to perl there are just strings. that makes it not easy to keep track what's what.
moritz daxim: ok, thanks! 20:52
chloekek daxim: Note that in PHP a string is always an array of bytes. In Perl, the elements of a string can be integers ≥ 256. 20:54
For some language features, PHP does assume that these byte strings have a particular encoding. For example (int)$s, assumes ASCII digits. 20:57
But always thinking of strings as byte strings, or arrays of bytes, or Blob, is the right thing to do, and when you need to extract linguistic properties, you need to assert a particular encoding. 20:58
Grinnz that's basically how it worked before perl 5.6. but instead of adding workarounds for it, they added an upgraded storage format 21:00
Geth ¦ problem-solving: vrurg assigned to jnthn Issue More language revision related questions needs resolving. github.com/Raku/problem-solving/issues/199 21:37