🦋 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.
AlexDaniel github.com/topics/raku 181 repos vs 372 repos github.com/topics/perl6 00:30
.seen Xliff 00:59
tellable6 AlexDaniel, I saw Xliff 2019-10-25T06:53:50Z in #raku-dev: <Xliff> o/
Geth_ perl6.org: 53e304963d | (Aleks-Daniel Jakimenko-Aleksejev)++ | 8 files
More Raku changes

Still leaving some places where more work is required, but now most pages talk about Raku.
02:56
SmokeMachine Does it make sense? www.irccloud.com/pastebin/TukGCFCK/ 03:24
rba AlexDaniel: I know. Subdomains are not completely ready yet. 05:04
xinming SmokeMachine: How to do multi column sort BTW? 08:03
xinming m: sub test ($y) { my @x; if $y { @x = <a b c> }; @x; }; test(True); 09:39
camelia ( no output )
xinming m: sub test ($y) { my @x; if $y { @x = <a b c> }; @x; }; test(True).say;
camelia [a b c]
xinming In this example, what is the perl6 way to write `my @x; if $y { @x = ... }; do-something with @x 09:40
SmokeMachine red: use Post; .say for Post.^all.sort: { .title, .body } # xinming, I don’t remember if it’s implemented... 09:55
ZzZombo m: my @x = if 'asd' { 1,2,3 };say @x 10:13
camelia 5===SORRY!5===
Word 'if' interpreted as a listop; please use 'do if' to introduce the statement control word
at <tmp>:1
------> 3my @x = if7⏏5 'asd' { 1,2,3 };say @x
Unexpected block in infix position (two terms in a row)
at <tmp>:…
ZzZombo m: my @x = do if 'asd' { 1,2,3 };say @x
camelia [1 2 3]
ZzZombo m: my @x = do if False { 1,2,3 };say @x
camelia []
SmokeMachine red: use Post; .say for Post.^all.sort: { .title, .body } # xinming, I don’t remember if it’s implemented... 11:01
redable SmokeMachine, gist.github.com/04f6e837f9ceae9755...c55bf6f988
SmokeMachine red: use Post; my $*RED-DEBUG = True; .say for Post.^all.sort: { .title, .body } 11:02
redable SmokeMachine, gist.github.com/33537e9ee8955dbee0...d5d6cdeb6e
SmokeMachine xinming: yes, it's working... ^^
tbrowder hi, raku people! 11:37
is it true that in a substituion like: s/some stuff/any literal/ 11:38
tbrowder any char between the second pair of forward slashes is valid as a substitution (except another forward slash which must be escaped)? 11:41
SmokeMachine red: use Post; say Post.^all.pick 11:44
tbrowder m: s/foo/'/ 11:46
camelia Use of uninitialized value of type Any in string context.
Methods .^name, .perl, .gist, or .say can be used to stringify it to something meaningful.
in block <unit> at <tmp> line 1
tbrowder s/foo/bar/
m: s/foo/bar/ 11:47
camelia Use of uninitialized value of type Any in string context.
Methods .^name, .perl, .gist, or .say can be used to stringify it to something meaningful.
in block <unit> at <tmp> line 1
SmokeMachine red: use Post; say Post.^all.pick 11:49
tbrowder m: s/foo/bar/; .say
camelia Use of uninitialized value of type Any in string context.
Methods .^name, .perl, .gist, or .say can be used to stringify it to something meaningful.
(Any)
in block <unit> at <tmp> line 1
redable SmokeMachine, Post.new(id => 1, title => "test1", body => "body-test1", deleted => 0, created => DateTime.new(2019,10,22,12,0,19.196347), tags => Set.new(""))␤
tbrowder m: $_ = 'foo'; s/foo/'/; .say 11:50
camelia '
SmokeMachine red: use Post; my $*RED-DEBUG = Trur; say Post.^all.pick
redable SmokeMachine, 04===SORRY!04=== Error while compiling /code/./code.p6␤Undeclared name:␤ Trur used at line 2. Did you mean 'True'?␤␤
SmokeMachine red: use Post; my $*RED-DEBUG = True; say Post.^all.pick
redable SmokeMachine, gist.github.com/9942a10ffb9399b49f...7bf9ccddf6
SmokeMachine red: use Post; my $*RED-DEBUG = True; say Post.^all.pick: 5
redable SmokeMachine, gist.github.com/5e15679012d7084c5b...39d6b5a4d5
tbrowder m: $_ = 'foo'; s/foo/%/;.say 11:51
camelia %
tbrowder $_ = 'foo';s/foo/%(/;.say 11:52
m: $_ = 'foo'; s/foo/%(/.say 11:53
camelia 5===SORRY!5===
Regex not terminated.
at <tmp>:1
------> 3$_ = 'foo'; s/foo/%(/.say7⏏5<EOL>
Unable to parse regex; couldn't find final '/'
at <tmp>:1
------> 3$_ = 'foo'; s/foo/%(/.say7⏏5<EOL>
expecting any of:
SmokeMachine xinming: ^^
tbrowder m: $_='foo';s/foo/%\(/.say 11:54
camelia 「foo」
tbrowder m: $_='foo';s/foo/\%(/;.say 11:57
camelia %(
tbrowder m: $_='foo';s/foo/\%\(/;.say 11:58
camelia %(
tbrowder m: $_='f';s/f/\a/;.say 11:59
camelia
Geth_ doc: tusindfryd++ created pull request #3076:
Fix broken links
12:00
tbrowder so what should we do about the docs? i think we need some more specifics in the section on substitution about some restrictions on the substitution part. at the moment there are none. 12:02
Ulti is there a spec for the current Raku things somewhere? like file endings, I know they changed from the initial discussion 12:05
I'm working on a little tool to port all of my existing modules so figure I can also upload it for everyone else 12:06
unless some brave soul has already done this?
MasterDuke Ulti: github.com/perl6/problem-solving/b...to-Raku.md has some info. i thought there was a doc explicitly targeting module authors that jnthn++ wrote, but i either can't find it or am imagining things 12:22
Geth_ doc: b839acebab | (Tom Browder)++ (committed using GitHub Web editor) | doc/Language/regexes.pod6
start section on substitution RHS restrictions

More specifics need to be added.
12:29
tbrowder .ask tony-o is there any way to put a unique(cola, colb) constraint using Xoos (SQLite)? 12:49
tellable6 tbrowder, I'll pass your message to tony-o
SmokeMachine red: model MultColUnique { has $.a is column; has $.b is column; ::?CLASS.^add-unique-constraint: { .a, .b } }; $*RED-DEBUG = True; MultColUnique.^create-table 12:59
:( 13:00
AlexDaniel SmokeMachine: well, the bot is offline :P 13:12
xinming SmokeMachine: How about NULLS FIRST, NULLS last 13:45
SmokeMachine AlexDaniel: yes... probably my machine is sleeping... 14:08
xinming: what do you mean? 14:09
xinming SmokeMachine: SELECT ... ORDER BY xx ASC NULLS FIRST, yyy DESC NULLS LAST; 14:15
SmokeMachine Myo 14:18
Nyi
xinming So, If you plan to implement it, what the idea will it be? 14:28
Something like, null-first(.a), null-last(.b) ?
SmokeMachine xinming: idk yet... but I’ll try to find a Raku native way of doing that... 15:11
xinming: have you seen the pick?
Geth_ whateverable: b08ffef6f0 | (Aleks-Daniel Jakimenko-Aleksejev)++ | 2 files
Make it stop joining #perl6 and #perl6-dev

With a temporary hack for evalable and tellable because these are still needed sometimes.
15:14
xinming SmokeMachine: What pick? Do you mean your answer for multi column sort? 15:20
SmokeMachine github.com/FCO/Red/commit/8a360962...aa5e2fR322 15:28
xinming: ^^
Geth_ perl6.org: 19f88526cb | (Aleks-Daniel Jakimenko-Aleksejev)++ | source/downloads/index.html
Fix bold title (Raku)

Somehow I missed it in the last commit
15:30
xinming SmokeMachine: saw it, thanks, I understood how pick is implemented now. 16:37
SmokeMachine xinming: and what do you think about this? github.com/FCO/Red/commit/54f29096...080fb7R132 16:47
xinming Do you mean red-do? 17:09
If you mean red-do, I do wish some way of support like red-do <db1 db2> -> ($db1, $db2) { use db1 and db2 here }; 17:20
SmokeMachine xinming: I was meaning `red-do :transaction` 17:21
xinming Ah, That way looks good
SmokeMachine xinming: `red-do <db1 db2> => { ... }` will run the block twice, one for db1 and other for db2... 17:23
xinming SmokeMachine: Yea, I know the red-emit/red-tap will be used to exchange data between databases. I don't think the idea is good. 17:24
But it seems, Since we don't have "schema" object, We can't pass schema's around.
SmokeMachine xinming: and you can also do `red-do db1 => { do something with db1 }, db2 => { do something with db2 }` 17:25
xinming Yea, What if db1 needs to access db2?
we have to do red-do db1 => { red-do db2 => { }; }; 17:26
we'll need many red-do db2 if we need to query databases interacively.
SmokeMachine xinming: could you please give me an example? 17:27
SmokeMachine I still can’t see why one would be changing the database that way... 17:30
Unless it’s for master/slave DBs... and for that we have a better solution planned... 17:31
xinming SmokeMachine: termbin.com/cuf0 17:33
SmokeMachine github.com/FCO/Red/issues/153#issu...-486462089
xinming Not for master/slave sollution, It's just for doing things as easy as possible.
I think red-do within red-do is acceptable. 17:34
better than doing temp $*RED-DB = ... all the time.
another question, red-defaults db1 => \("SQLite", :default), db2 => (my $db2 = database("SQLite")); <--- Why do we use Capture in the firt db1 arg? 17:35
I know the db2 => (my $db2 = database("...")); my $db2 is used to access $db2 later
does database declared with "capture" the "default" one? 17:36
SmokeMachine xinming: just to show both are acceptable...
xinming Got it, thanks 17:38
SmokeMachine xinming: you can always do something like: `sub process-result(..., :$with = “db1”) { red-do :$with, { ... } }` 17:44
xinming Yea, We can wrap them into utilty functions
But be better if we have them as default.
discord6 <Rogue> How does one destructure a list of Pairs in a for loop? 20:16
<Rogue> I'm trying to give the keys and values more descriptive names
tobs m: my @a = :1a, :2b, :3c; for @a -> (:key($foo), :value($bar)) { say "$foo → $bar" } 20:22
camelia a → 1
b → 2
c → 3
uzl[m] Wow, Raku never ceases to amaze me. I'd have probably done 20:27
m: my @a = :1a, :2b, :3c; for @a -> $pair { my ($foo, $bar) = $pair.kv; say "$foo → $bar" }
camelia a → 1
b → 2
c → 3
uzl[m] So the loop is binding a pair to $_ but how the colon pair in the signature works? 20:30
AlexDaniel` m: my @a = :1a, :2b, :3c; for @a -> (:$key, :$value) { say "$key → $value" }
camelia a → 1
b → 2
c → 3
uzl[m] Oh, it's just an old named parameter but in the first case, it's also creating an alias. I've seen it in MAIN subs but didn't extrapolate it to loops. 20:35
discord6 <Rogue> huh, I guess I should have thought of objects as fancy hashes 21:55
<Rogue> that makes sense, thanks tobs and AlexDaniel 21:56
timotimo that's what happens if your class defines a Capture method 22:23