🦋 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. |
|||
00:03
patrickz joined
00:05
melezhik left
00:06
wamba left
00:07
patrickb left
00:10
Xliff joined,
AlexDaniel left
00:23
aborazmeh left
00:24
aborazmeh joined,
aborazmeh left,
aborazmeh joined
00:35
aborazmeh left,
aborazmeh joined,
aborazmeh left,
aborazmeh joined
00:49
pecastro left,
Kaeipi joined,
Kaiepi left
00:54
zacts left
|
|||
Xliff | \o | 01:00 | |
01:12
Kaeipi left
01:13
Kaeipi joined
01:14
Kaeipi left
01:15
holli__ left,
Kaeipi joined,
Kaeipi left
01:16
Kaeipi joined
01:17
Kaeipi left
01:19
Kaiepi joined
01:20
Kaiepi left
01:21
Kaiepi joined
01:22
Kaiepi left
01:23
Kaiepi joined,
Kaiepi left
01:27
Kaiepi joined
01:48
Xliff left,
maggotbrain left
02:14
zacts joined
02:15
molaf left
02:28
molaf joined
02:37
zacts left
02:50
mithaldu_ left,
kawaii left
02:51
peteretep left,
peteretep joined,
mithaldu_ joined
02:52
kawaii joined,
spycrab0 left
02:54
spycrab0 joined
03:20
Kaiepi left
03:21
Kaiepi joined
03:40
zacts joined
03:41
Kaiepi left,
Kaiepi joined
|
|||
xinming | m: module A { class B { }; class B::C { } }; B.raku.say; | 03:56 | |
camelia | A::B | ||
xinming | In this example, we don't have B declared in global namespace, But we have `constant B = A::B` alias, Is this a bug? | ||
04:08
cpan-raku joined,
cpan-raku left,
cpan-raku joined
04:35
aborazmeh left
04:54
aborazmeh joined,
aborazmeh left,
aborazmeh joined
05:08
orinthe left,
orinthe joined
05:24
BenGoldberg left
05:26
frost-lab joined
05:52
aborazmeh left
06:01
xinming_ joined
06:04
xinming left
06:12
Summertime left
06:14
Summertime joined
06:25
brass_ joined
06:26
brass left
06:31
sena_kun joined
06:33
parabolize left
06:36
DarthGandalf left
06:44
holli__ joined
|
|||
xinming_ | SmokeMachine: paste.debian.net/1169329/ <--- Where did I do wrong in this example? | 07:05 | |
07:15
Kaeipi joined,
sjm_uk joined,
Kaiepi left
07:22
sno joined
07:29
Kaeipi left
07:30
Kaeipi joined
07:37
Kaeipi left
07:38
Kaiepi joined
07:50
jmerelo joined
07:54
Kaiepi left,
Kaiepi joined
08:01
squashable6 left
08:02
skids left
08:03
Kaiepi left,
squashable6 joined
08:04
Kaiepi joined
08:07
natrys joined
08:08
Altai-man joined
08:10
sena_kun left
08:15
BenGoldberg joined
08:25
frost-lab left
08:26
sno left
08:27
cxreg left
08:29
holli__ left
08:44
cpan-raku left
08:49
frost-lab joined,
BenGoldberg left
08:52
Sgeo left
09:01
cpan-raku joined,
cpan-raku left,
cpan-raku joined
09:07
wamba joined
09:31
sno joined
09:35
wamba left
09:36
wamba joined
09:39
domm left
09:56
holli__ joined
10:06
frost-lab left
10:20
domidumont joined
10:25
domidumont left
10:28
domidumont joined
10:29
patrickz left
10:36
sno left
10:50
pecastro joined
11:08
sjm_uk left
11:39
holli__ left
11:40
BenGoldberg joined
11:42
holli__ joined,
Black_Ribbon left
11:46
|oLa| joined
11:49
sjm_uk joined
12:04
|oLa| left
12:09
sena_kun joined
12:10
Altai-man left
12:14
BenGoldberg left
12:17
wamba left
12:18
aborazmeh joined,
aborazmeh left,
aborazmeh joined
|
|||
SmokeMachine | xinming_: interesting code! Is that giving error? I’m not sure if I ever tested a column being a pk and a fk at the same time | 12:38 | |
xinming_ | SmokeMachine: Yea, It'll report an error | 12:42 | |
Something like, Type check failed in assignment to $!right; expected Red::AST but got Slip (Empty) | 12:43 | ||
12:44
jmerelo left
|
|||
SmokeMachine | xinming_: would you mind to open a issue with that? I’ll take a look | 12:44 | |
12:49
holli__ left
|
|||
xinming_ | SmokeMachine: github.com/FCO/Red/issues/449 | 12:53 | |
12:54
jmcgnh left
12:56
rindolf joined
|
|||
SmokeMachine | It should be referencing *.id and not *.a-id | 12:59 | |
xinming_: it should be referencing *.id and not *.a-id and it’s :references instead of :referencing | 13:00 | ||
xinming_ | m: m: module A { class B { }; class B::C { } }; B.raku.say; | ||
camelia | A::B | ||
xinming_ | m: module A { class B { }; class B::C { } }; B.raku.say; | ||
camelia | A::B | ||
SmokeMachine | (Sorry my app haven’t showed me my first message) | 13:01 | |
13:02
jmcgnh joined
|
|||
xinming_ | SmokeMachine: So, you mean something like: has Int $.a-id is column{ :id, :references(*.id, :model-name<A>) }; | 13:02 | |
?? | |||
SmokeMachine | Yes | ||
xinming_ | then, we'll get this error: On Red:api<2> references must declaire :model-name and the references block must receive the model as reference | 13:03 | |
I tried both :model-name<A> and :model(A) and :model<A> | |||
Hmm, ignore me, I'll try again | 13:04 | ||
SmokeMachine | Sorry, I’ll try it... just not with my computer right now | ||
Odd: github.com/FCO/Red/blob/master/lib...ts.pm6#L69 | 13:06 | ||
xinming_ | SmokeMachine: works with has Int $.a-id is column{ :id, :references(*.id), :model-name<A> } | 13:07 | |
BTW, How do we declare has-one relationship? in that example, we can have $a-result an accessor to the b | 13:08 | ||
SmokeMachine | So, is that working now? | 13:09 | |
Sorry, that is a has-one relationship, isn’t it? | 13:10 | ||
xinming_ | has Int $.a-id is column{ :id, :references(*.id), :model-name<A> } <--- This version works | ||
SmokeMachine: The B to A is a belongs-to relationship | |||
But A might-have a B | 13:11 | ||
is not belongs-to | |||
I'll trouble you later before I try more. | |||
SmokeMachine | Currently the only way would be treat that as a has-many, adding a @ sigil on that | 13:12 | |
xinming_ | Ok, doesn't seem to be a good sollution. | 13:14 | |
BTW, for views, I think we can do something like, `model x is view('aaa')` to mean view created, and `model x is view { }` to mean virtual views. | 13:15 | ||
SmokeMachine | xinming_: about the pk and fk at the same time, would you do me a favor? Would you mind to write that as a cookbook entry, please? fco.github.io/Red/tutorials/cookbook.html | ||
xinming_ | Then, we can do something like, model x is view(view-name) is content('view-definition') { has $.a is column; has $.b is column; } | 13:16 | |
SmokeMachine: Ok, will do that. | |||
SmokeMachine | About the created views I was thinking of using the `is temp` that already exists... but I’m not sure if it’s a good idea | 13:17 | |
xinming_ | `is temp` is used for creating temp table, I don't think it's a good idea. | 13:18 | |
BTW, when I read the source code about `is temp`, it got me thinking, is there a way to curry the temp table with predefined table name? | 13:19 | ||
SmokeMachine | Yes, makes sense | ||
Not sure... | 13:20 | ||
xinming_ | For example, TmpModel is temp { }; then in code, we can do something like, my $user-specific-tmp-table = TmpModel.^create-temp-table: :table-name<abc> | ||
Then, $user-specific-tmp-table will just curry the TmpModel with predefined table-name to query. | 13:21 | ||
Is that a good idea? | 13:22 | ||
SmokeMachine | I think so... but I wouldn’t call that `create-tmp-table` it’s already defined as temp... maybe just a `create-table` should be enough | 13:26 | |
xinming_ | BTW, is it possible for us to do something like `temp Model.table-name = 'new-table'` name now? | 13:27 | |
How do we change the table name at runtime? | |||
SmokeMachine | Maybe a TmpModel.^alias(“otherName”).^create-table` should work | ||
xinming_ | SmokeMachine: I think it's best to hold the curried model within a variable. | 13:28 | |
SmokeMachine | Not sure... would you mind if I search for that in a few moments? I’m doing the dishes now... | 13:29 | |
xinming_ | Ok | ||
13:41
zacts left
|
|||
SmokeMachine | xinming_: this seems to work, but I don't think that's a goos way of doing that... www.irccloud.com/pastebin/eCIfE3u6/ | 14:04 | |
14:23
BenGoldberg joined
|
|||
xinming_ | SmokeMachine: There are some places where it saves a lot of times, Which is like, we have 2 table, one is archive, and another is live data table. | 14:27 | |
SmokeMachine: I've created the pull request for the doc/cookbook.md update. BTW, I have another branch which is mostly postgres fix, I'll enchance when I have time. Now busy with other things. | 14:39 | ||
14:45
parabolize joined,
mid_home left
14:52
vgrato_ left
15:05
rindolf left,
rindolf joined
15:07
zacts joined
|
|||
xinming_ | m: module A { class B { }; class B::C { } }; B.raku.say; # <-- in this example, The namespace B is created globally, Is this a bug or a feature? | 15:09 | |
camelia | A::B | ||
15:12
zacts left
15:35
Kaiepi left
15:40
sno joined
15:42
MilkmanDan left,
MilkmanDan joined
15:57
Kaiepi joined
16:00
aborazmeh left
16:01
Kaiepi left
16:03
xelxebar left
|
|||
xinming_ | SmokeMachine: How do we specify the column type of database? now, I found that most column types are incorrect, `has DateTime $.dt is column` emits VAR(255) length string. | 16:05 | |
SmokeMachine | you can use :type for defining that | 16:06 | |
16:07
xelxebar joined
16:08
Altai-man joined,
Kaiepi joined
16:09
sjm_uk left
16:10
MilkmanDan left,
sena_kun left,
holli__ joined
16:11
MilkmanDan joined
|
|||
SmokeMachine | xinming_: this is the reason: github.com/FCO/Red/blob/master/lib...L.pm6#L762 | 16:20 | |
xinming_ | SmokeMachine: I know, I think it's best that we specify it manually, also, we specify the default value for the database literraly | 16:25 | |
SmokeMachine | xinming_: sorry, I didn't get it... | 16:29 | |
xinming_ | SmokeMachine: model A { has DateTime $.dt is column = DateTime.now }; Wether we can do something like, model A { has DateTime $.dt is column{:type<timestamp>, :default<now>} } | 16:32 | |
Will generate sql which is like CREATE TABLE aa { dt timestamp NOT NULL DEFAULT now }; | 16:33 | ||
SmokeMachine: model A { has DateTime $.dt is column = DateTime.now }; Wether we can do something like, model A { has DateTime $.dt is column{:type<timestamp>, :default('now()')} } | |||
If people want the 'now()' to be string, We can do something like :default(q{'now()'}) | 16:34 | ||
SmokeMachine | xinming_: I'm still deciding how to do the default value... I don't really like to make it with "SQL" | 16:35 | |
xinming_ | SmokeMachine: We still need that feature finally. We can have the most sane default, But we do need a way to inject the plain SQL some way. | 16:36 | |
SmokeMachine | xinming_: I'm more like doing something like: `has DateTime $.dt is column{:type<timestamp>, :default{ .now }} ` | ||
xinming_ | Yea, the .now is an example. What if we want an xml column, with default xml? | 16:37 | |
Or geo location column in pg. I know you hate plain sql, But you can't avoid it | |||
SmokeMachine | maybe using something like this: github.com/FCO/Red/blob/master/lib...ds.pm6#L65 | 16:38 | |
xinming_ | I face this many times in p5 DBIC. | ||
SmokeMachine | in that case ww could use Red::AST::Function | 16:39 | |
or use something like RED::AST::Generic (github.com/FCO/Red/tree/master/lib...T/Generic) | |||
xinming_ | Ok, Will follow your decision. ;-) | 16:41 | |
16:44
sjm_uk joined
16:45
MilkmanDan left
16:47
MilkmanDan joined
|
|||
xinming_ | m: ("a" ~~ Str).raku.say; | 16:47 | |
camelia | Bool::True | ||
16:47
holli__ left
|
|||
xinming_ | m: my $_ = "a"; Str.ACCEPTS($_); # docs.raku.org/routine/~~ <--- Am I right understanding the smart match operator? | 16:48 | |
camelia | Potential difficulties: Redeclaration of symbol '$_'. at <tmp>:1 ------> 3my $_7⏏5 = "a"; Str.ACCEPTS($_); # do » | ||
xinming_ | m: temp $_ = "a"; Str.ACCEPTS($_); # docs.raku.org/routine/~~ <--- Am I right understanding the smart match operator? | ||
camelia | ( no output ) | ||
xinming_ | m: temp $_ = "a"; Str.ACCEPTS($_).raku.say; # docs.raku.org/routine/~~ <--- Am I right understanding the smart match operator? | ||
camelia | Bool::True | ||
xinming_ | Left is aliased to $_, then, call the .ACCEPTS method from the right hand side. | ||
after some testing, seems I'm right. | 16:50 | ||
16:54
sno left,
sno joined
17:09
parabolize left
17:31
oneeggeach joined,
oneeggeach left,
aborazmeh joined,
aborazmeh left,
aborazmeh joined
17:36
perryprog left
17:37
perryprog joined
17:40
bocaneri left
|
|||
SmokeMachine | .tell kawaii I've closed github.com/FCO/Red/issues/448, but if you think it's not ok yet, please open it again. | 17:47 | |
tellable6 | SmokeMachine, I'll pass your message to kawaii | ||
17:49
bocaneri joined
17:56
MilkmanDan left,
MilkmanDan joined
17:58
bocaneri left,
bocaneri joined
18:00
wamba joined
18:30
oneeggeach joined,
oneeggeach left,
oneeggeach joined
18:31
oneeggeach left,
oneeggeach joined
18:32
oneeggeach left,
oneeggeach joined
18:33
oneeggeach left,
oneeggeach joined,
oneeggeach left
18:34
oneeggeach joined,
oneeggeach left,
oneeggeach joined
18:35
oneeggeach left
18:39
holli__ joined,
Sgeo joined
18:55
domidumont left
|
|||
kawaii | SmokeMachine: I didn't have any problems with it, but I'm not using named uniques, just multiple, it's probably fine :) | 18:59 | |
tellable6 | 2020-10-31T17:47:17Z #raku <SmokeMachine> kawaii I've closed github.com/FCO/Red/issues/448, but if you think it's not ok yet, please open it again. | ||
Geth | doc: a21340f2b2 | Coke++ | 2 files Make dep on Documentable "official" Update build directions to install deps from META6.json |
19:13 | |
19:22
holli__ left,
oneeggeach joined
19:23
roguelazer left
19:25
oneeggeach left
|
|||
Geth | ¦ doc: coke self-assigned Spin off Pod::Convenience github.com/Raku/doc/issues/2696 | 19:33 | |
[Coke] | .ask jjmerelo - to avoid github ticket volleyball, do you agree that we should reject tickets regarding 'p6doc' executable since it is no longer in the repo? If so, I'm happy to do the ticket cleanup. | 19:35 | |
tellable6 | [Coke], I'll pass your message to jmerelo | ||
[Coke] | .ask jjmerelo - I will also save the list of tickets for the new repo so whoever owns it can extract the bug info if they need it. | ||
tellable6 | [Coke], I'll pass your message to jmerelo | ||
19:38
holli__ joined
|
|||
[Coke] | ... I do like that it dealt with my typo. | 19:39 | |
Geth | ¦ doc: coke assigned to Altai-man Issue Convert static site to dynamic site github.com/Raku/doc/issues/1246 | 19:41 | |
19:44
sjm_uk left
19:58
sjm_uk joined
|
|||
Geth | ¦ doc: Altai-man self-assigned Test documentable github.com/Raku/doc/issues/2972 | 20:03 | |
20:09
sena_kun joined
20:10
Altai-man left
20:14
Sgeo_ joined
20:18
Sgeo left
|
|||
cpan-raku | New module released to CPAN! Universal::errno (0.0.3) by 03GARLANDG | 20:18 | |
20:22
[Sno] joined
|
|||
Zero_Dogg | [Coke]: Is there a replacement for p6doc? | 20:23 | |
20:24
sno left
20:26
cxreg joined,
zacts joined
20:27
cxreg left,
cxreg joined
20:29
markmarkmark joined
20:32
ape666 joined
|
|||
[Coke] | Zero_Dogg: github.com/Raku/rakudoc | 21:01 | |
no idea if it's in a better state than p6doc was. | |||
21:03
grep0r joined
|
|||
Zero_Dogg | well, p6doc isn't installable at all, so if it installs, that'll be an improvement (though it's not on cpan it seems) | 21:03 | |
21:03
grep0r left
21:04
aborazmeh left
21:05
JustThisGuy joined
|
|||
[Coke] | p6doc isn't in the repo anymore. | 21:06 | |
(and yes, before that it was super busted.) | |||
Zero_Dogg | 'zef install p6doc' does try to install something, though | ||
granted, it fails at it, but still | |||
[Coke] | Can't speak to that one. There was one in raku/doc before that's gone now. | 21:09 | |
Zero_Dogg | rakudoc fails its tests. Sigh. perldoc has spoiled me. | 21:11 | |
JustThisGuy | Hi all! Given a codepoint e.g. 1F1E9 1F1EA I want to be able to get .uniname. I've been googling and reading the docs, and I see that .NFC returns a codepoint, but I want to do the inverse and create a string from a codepoint. Thanks! | ||
21:15
sjm_uk left
|
|||
moritz | m: say "\x[1F1E9,1F1EA]" | 21:15 | |
camelia | 🇩🇪 | ||
moritz | JustThisGuy: or do you want to create a string from the codepoint name? | 21:16 | |
JustThisGuy | m: say "\x[1F1E9,1F1EA]".uniname | ||
camelia | REGIONAL INDICATOR SYMBOL LETTER D | ||
moritz | m: say "\x[1F1E9,1F1EA]".uninames | 21:17 | |
camelia | (REGIONAL INDICATOR SYMBOL LETTER D REGIONAL INDICATOR SYMBOL LETTER E) | ||
JustThisGuy | That's what's confusing me is "REGIONAL INDICATOR SYMBOL LETTER D". I'm looking for "German Flag" or similar. | ||
moritz | well, there's the official Unicode database, which mostly has just one name for each codepoint. That's what Raku offers you | 21:18 | |
if you want other names for that, you must look elsewhere for other data sources that map "vulgar" names to codepoints | |||
JustThisGuy | OK. Thanks! | 21:19 | |
21:19
JustThisGuy left
21:23
Manifest0 joined
21:49
natrys left
|
|||
cpan-raku | New module released to CPAN! Red (0.1.27) by 03FCO | 21:50 | |
22:00
ape666 left
22:03
mid_home joined
22:04
rindolf left
22:05
parabolize joined
|
|||
cpan-raku | New module released to CPAN! Universal::errno (0.0.4) by 03GARLANDG | 22:05 | |
22:11
Ben_Goldberg joined,
BenGoldberg left,
Ben_Goldberg is now known as BenGoldberg,
sena_kun left
22:13
roguelazer joined
22:39
zacts left
23:06
lizmat_ joined,
lizmat left,
lizmat_ is now known as lizmat
23:07
Xliff joined
|
|||
Xliff | \o | 23:07 | |
How would one go searching a Buf for a byte pattern? | 23:08 | ||
23:14
lizmat_ joined
23:15
lizmat__ joined
23:17
aindilis left,
mowcat joined,
lizmat left,
lizmat__ is now known as lizmat
23:18
lizmat_ left
|
|||
[Coke] | (german flag) - the flags are combos of the 2 letter country ids. | 23:20 | |
m: say "\C[REGIONAL INDICATOR SYMBOL LETTER D][REGIONAL INDICATOR SYMBOL LETTER E | |||
camelia | 5===SORRY!5=== Error while compiling <tmp> Unrecognized backslash sequence: '\C' at <tmp>:1 ------> 3say "\7⏏5C[REGIONAL INDICATOR SYMBOL LETTER D][RE expecting any of: argument list double quotes te… |
||
[Coke] | m: for <F G> -> $l { say "\c[REGIONAL INDICATOR SYMBOL LETTER D]\c[REGIONAL INDICATOR SYMBOL LETTER $l]" | 23:22 | |
camelia | 5===SORRY!5=== Error while compiling <tmp> Unrecognized character name [REGIONAL INDICATOR SYMBOL LETTER $l] at <tmp>:1 ------> 3D]\c[REGIONAL INDICATOR SYMBOL LETTER $l7⏏5]" |
||
Xliff | Huh! For now I had to roll my own: sub c-decode ($b) { | ||
my $i = 0; $i++ while $b[$i]; $b.subbuf(0, $i).decode } | |||
[Coke] | awwww | ||
m: for <F G> -> $l { say "\c[REGIONAL INDICATOR SYMBOL LETTER D]" ~ "REGIONAL INDICATOR SYMBOL LETTER $l".parse-names } | 23:24 | ||
camelia | 🇩🇫 Saw 1 occurrence of deprecated code. ================================================================================ Method parse-names (from Str) seen at: <tmp>, line 1 Please use uniparse instead. ----------------------------… |
||
[Coke] | m: for <E G> -> $l { say "\c[REGIONAL INDICATOR SYMBOL LETTER D]" ~ "REGIONAL INDICATOR SYMBOL LETTER $l".uniparse } # yes? | ||
camelia | 🇩🇪 🇩🇬 |
||
[Coke] | whew. | ||
Geth | doc/coke/pod: 747898fca8 | Coke++ | 5 files Switch to POD::Utilities |
23:39 | |
23:47
Ben_Goldberg joined,
BenGoldberg left,
Ben_Goldberg is now known as BenGoldberg
|