🦋 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.
moon-child m: say [+] 1024..* 00:16
camelia Inf
timotimo m: .say for [\+] 1024..* 00:20
camelia (timeout)1024
2049
3075
4102
5130
6159
7189
8220
9252
10285
11319
12354
13390
14427
15465
16504
17544
18585
19627
20670
21714
22759
23805
24852
25900
26949
27999
29050
30102
31155
32209
332…
jmou hi! i am just learning raku. wondering if anyone can explain ~~ with Match objects 00:41
m: 'a' ~~ /(.)/; say 'b' ~~ $0
camelia 「a」
jmou m: 'a' ~~ /(.)/; say 'b' ~~ ~$0
camelia False
timotimo sourceable6: Match.new(), ACCEPTS
sourceable6 timotimo, No idea, boss. Can you give me a Code object? Output: 04===SORRY!04=== Error while compiling /tmp/QoacIMGixr␤Undeclared name:␤ ACCEPTS used at line 1␤␤
timotimo sourceable6: Match.new(), "ACCEPTS"
sourceable6 timotimo, No idea, boss. Can you give me a Code object?
jmou Match doesn't seem to have ACCEPTS, so wondering why it returns a truthy in the first example? 00:42
AlexDaniel` sourceable6: Match.new().ACCEPTS 00:44
sourceable6 AlexDaniel`, github.com/rakudo/rakudo/blob/4b6b...Mu.pm6#L20
AlexDaniel` timotimo: why overthink it :)
timotimo haha, ok
AlexDaniel` sourceable6: Match.new().ACCEPTS(‘foo’)
sourceable6 AlexDaniel`, github.com/rakudo/rakudo/blob/4b6b...h.pm6#L238
jmou ah so it does have ACCEPTS... 00:46
timotimo is it docced at all? 00:47
jmou is there an intuition for why a Match object should return itself in ~~ ?
mmm i don't think so... docs.raku.org/routine/ACCEPTS
found the commit for Match.ACCEPTS *hmm* github.com/rakudo/rakudo/commit/b4...3fa5a94776 00:53
timotimo it's probably for when you have something that does a match on the RHS on ~~ 01:25
like a $blan ~~ m/foo/ would do that
jmou ah i can see that. i suppose you could also write $blah ~~ /foo/ to not use a Match on the RHS 01:30
but it makes sense
timotimo coverage data from the tests should be able to tell us what tests that it does that, and then we'd also have the right spot in the design documents to look 02:07
xinming Can we do multi dispatch on whenever? 03:04
timotimo not sure how exactly you mean that
xinming Something like, react { whenever $supply -> ('a') { ... }; whenever $supply -> ('b') { ... } }; 03:05
timotimo you can use multile `when` inside of a `whenever` since it sets `$_`
xinming got it, thanks
timotimo you could do that with .grep on supplies, but then you won't have "if a more specific rule matched, don't match any of the others" semantics like given/when or multi-dispatch haev 03:06
xinming timotimo: Thanks, Will use `when` approach 03:09
m: my $s = supply { emit(("X", "a")); emit(("Y", "b")) }; react { whenever $s { when (my $t, "a") { $t.say }; when ($t, "b") { "b".say } } } 03:17
camelia (Any)
b
xinming timotimo: Is it possible to do assignment to var too?
Just like multi dispatch, the var is also assigned.
timotimo m: given ("X", "a") { when :(my $t, "a") { say $t }; say "hmm" } 03:19
camelia 5===SORRY!5=== Error while compiling <tmp>
Invalid typename 'my' in parameter declaration.
at <tmp>:1
------> 3given ("X", "a") { when :(my7⏏5 $t, "a") { say $t }; say "hmm" }
timotimo m: given ("X", "a") { when :($t, "a") { say $t }; say "hmm" }
camelia 5===SORRY!5=== Error while compiling <tmp>
Variable '$t' is not declared
at <tmp>:1
------> 3iven ("X", "a") { when :($t, "a") { say 7⏏5$t }; say "hmm" }
timotimo m: given ("X", "a") { when :(*, "a") -> $t, "a" { say $t }; say "hmm" }
camelia ===SORRY!===
Internal error: find_var_decl could not find $_
timotimo haha, oops
that's not great
xinming :You find a bug
OUTPUT: «===SORRY!===␤Internal error: find_var_decl could not find $_␤» 03:20
notandinus what is the recommended config module? 07:45
star distribution included toml and yaml, should i go with those or simple ini? 07:46
moon-child notandinus: I would go with toml. Yaml is really annoying, and toml is basically formalised ini 07:50
notandinus moon-child: i see, toml looks good. i'll use that, thanks. 07:57
also do you have links to a good guide to read before creating a backup system for personal use? i'll just define profiles (list of files) & tar them. 07:58
moon-child noooo don't do that 08:01
use zfs
make snapshots 08:02
notandinus oh, i use obsd so no zfs 08:04
moon-child :/
I probably would use openbsd if it had zfs
notandinus is this a very bad idea? i've been taking daily backups of some files, i've put it in cron
seems to work fine, alsoit sync all files to other devices, very simple tar + gpg backup 08:05
what is recommended directory structure for a raku program? 08:09
epony merry OpenBSD Xmas! 09:49
notandinus what is the equivalent of strftime (Perl) in Raku? 10:08
sena_kun notandinus, docs.raku.org/type/Dateish#method_formatter <- ? 10:20
anx p6: say 3 12:15
camelia 3
anx Long back while i coded in perl, there was perl6 under development, also called parrot at the time. Is it renamed to Raku ? 12:18
tyil anx: yes 12:19
tellable6 2020-12-23T16:37:42Z #raku <melezhik> tyil Hi Patrick! Could you please comment on this? github.com/melezhik/sparky/pull/2#...-750376484 , thanks
anx Thanks for response tyil 12:20
lizmat anx: also, Parrot is no more, Raku currently runs on MoarVM, JVM and Javascript 12:21
anx ok, I would like to know more about raku. I will browse the website, thanks lizmat 12:22
notandinus sena_kun: i see, thanks 12:26
how do i do something like: " my @t = all elements of @set_a which are not present in @set_b" ? 12:27
i'm currently iterating over @set_a and pushing unless @set_b ∋ $ 12:29
sena_kun m: my $a = set(1, 2, 3); my $b = set(2); say $a (-) $b; 12:32
camelia Set(1 3)
sena_kun notandinus, there is a set difference operator
notandinus, docs.raku.org/language/operators#i..._%E2%88%96
notandinus sena_kun: ah isee, thanks, that's nice 12:36
notandinus how do i convert a set to a list? 13:37
i performed the set difference on 2 lists and it returned a set, i want to convert that to a list
grondilu m: say <foo bar>.Set.List 13:40
camelia (bar => True foo => True)
grondilu m: say <foo bar>.Set.List.keys
camelia (0 1)
grondilu :/
m: say <foo bar>.Set.List>>.keys
camelia ((foo) (bar))
grondilu m: say <foo bar>.Set.keys 13:41
camelia (foo bar)
grondilu ^probably like this
notandinus i see, thanks , its mentioned in docs/type/Set
just read that
xinming m: $_ = <a b>; when my ($a, $b) { .say; } 17:22
camelia ===SORRY!===
Cannot invoke this object (REPR: Null; VMNull)
xinming Is this a bug?
grondilu sourceable6: when 18:08
sourceable6 grondilu, No idea, boss. Can you give me a Code object? Output: 04===SORRY!04=== Error while compiling /tmp/sWHcp8vnOh␤Whitespace required after keyword 'when'␤at /tmp/sWHcp8vnOh:1␤------> 03when08⏏04<EOL>␤
grondilu m: when
camelia 5===SORRY!5=== Error while compiling <tmp>
Whitespace required after keyword 'when'
at <tmp>:1
------> 3when7⏏5<EOL>
grondilu had no idea 'when' was a keyword
m: given <a b> { when my $a { .say } } 18:09
camelia (a b)
grondilu m: given <a b> { when my ($a, $b) { .say } } 18:10
camelia ===SORRY!===
Cannot invoke this object (REPR: Null; VMNull)
grondilu m: given "foo" { when my ($a, $b) { .say } }
camelia ===SORRY!===
Cannot invoke this object (REPR: Null; VMNull)
grondilu m: given "foo" { when my ($, $) { .say } }
camelia ===SORRY!===
Cannot invoke this object (REPR: Null; VMNull)
grondilu m: given "foo" { when my $ { .say } }
camelia foo
grondilu looks like a bug indeed, though the semantic is dubious 18:11
m: given "foo" { when my $ { .say }; default { say "bar" } }
camelia foo
grondilu m: given "foo" { when my $ = 0 { .say }; default { say "bar" } }
camelia bar
melezhik there is a Sparky feature request - SCM polling VS web hooks discussion, join if you can - github.com/melezhik/sparky/issues/3 19:56
gfldex lolibloggedalittle: gfldex.wordpress.com/2020/12/25/coercive-files/ 23:00