🦋 Welcome to the MAIN() IRC channel of the Raku Programming Language (raku.org). Log available at irclogs.raku.org/raku/live.html . If you're a beginner, you can also check out the #raku-beginner channel!
Set by lizmat on 6 September 2022.
00:10 haxxelotto left
tbrowder i’ve been using a shell script to drive some raku scripts. maybe that’s obe now 00:20
and vice versa: raku driving bash 00:21
01:53 guifa joined 02:07 hulk joined 02:08 kylese left 02:17 MasterDuke joined
Voldenet Is there any good way of saying in MAIN `Int or "something"` in a way that's documented well? 02:34
currently I sort of fake it by `subset IntOrThing of Any where Int|"thing";` but it's pretty hideous 02:37
because I have to type the format manually in the parameter 02:38
and it gets tedious with more than one parameter 02:39
Xliff Format? Manually? "sub b ($a, $c, IntOrThing $foobar) { ... }" is easy enough, yes? 02:42
I'm confused as to why that's hideous.
Voldenet > IntOrMax :$days-ago = 20 #= max age to consider (Int or "max") 02:43
this is how it looks like
add a few parameters using this
it's hard to change the parameter and it feels ugly
Xliff Hmmm... nothing comes immediately to mind then, sorry. 02:44
Voldenet it'd be nice if I could somehow tell MAIN that the name of this subtype is actually 'Int | "max"' 02:45
02:45 guifa left
Voldenet So i'd get `–days-ago[=Int | "max"] max age to consider [default: 20]` in usage docs 02:45
currently the code uses `$constraints || $type.^name`, so it doesn't seem like it, but maybe there's some clever trick 02:53
Geth docker: m-dango++ created pull request #59:
Remove Travis
02:56
Voldenet Might be good if there was either `$type.WHY` or a trait for such override 02:58
or maybe role, no idea 03:08
03:15 hulk left, kylese joined 04:44 gabiruh left 04:47 jpn joined 04:49 gabiruh joined 04:51 jpn left 06:09 ptc joined 06:20 gabiruh left 06:51 gabiruh joined 07:16 gabiruh left 07:20 gabiruh joined 07:56 ptc left 08:28 Sgeo left
ab5tract m: ubse 08:38
camelia ===SORRY!=== Error while compiling <tmp>
Undeclared routine:
ubse used at line 1
ab5tract m: subset Max of Str where "max"; subset IntOrMax where Int|Max; my IntOrMax $a = 20; dd $a; $a = "max"; dd $a; $a = "min" 08:40
camelia IntOrMax $a = 20
IntOrMax $a = "max"
Type check failed in assignment to $a; expected IntOrMax but got Str ("min")
in block <unit> at <tmp> line 1
ab5tract Voldenet: that's how I would approach it, though I'm not sure how that gets documented when used in MAIN
08:53 sena_kun joined 09:01 dakkar joined 09:03 Manifest0 joined
Voldenet it doesn't get documented in MAIN either way 09:10
09:24 haxxelotto joined 09:34 haxxelotto left 09:36 jpn joined 09:38 haxxelotto joined
librasteve_ I find myself doing this contortion - the role is parameterised solely to ‘use Unit’ over in the role and avoid ‘Circular module loading detected’ error - is there a way to go class X does Thing[X] {…} without stubbing X {…} beforehand? www.irccloud.com/pastebin/nquT5HXJ 09:39
Voldenet eh, posted thing does look like crtp 09:50
thanks to that [::Unit] 09:56
librasteve_ just remembered ```class X { also does Thing[X]; … } ``` 10:03
thanks for rubber ducking
Voldenet anytime 10:04
10:35 jpn left
Geth docker: 8eb5bec716 | (Daniel Mita)++ (committed using GitHub Web editor) | 2 files
Remove Travis (#59)
10:55
11:03 jpn joined 12:40 jpn left 13:27 jpn joined
tbrowder [Coke]: CSV::Table WILL handle quoted text (with ligit quote pairs, see new table in repo), and probably will handle embedded newlines as well as tables without a header 13:52
but no binary files 13:55
[Coke] tbrowder++ 13:57
14:04 librasteve_ left
antononcube Happens often in FL. I had simlar/same experience in Jacksonville, FL in 2017. 14:34
14:43 Sgeo joined 14:49 gabiruh left 15:16 gabiruh joined 15:24 vlad joined 15:35 xinming left 15:46 haxxelotto left 15:55 vlad left 15:59 [Coke]_ joined
[Coke]_ tests something. 15:59
16:00 [Coke] left 16:02 xinming joined 16:06 haxxelotto joined 16:50 [Coke] joined 16:53 [Coke]_ left 17:03 jpn left 17:31 dakkar left 18:03 jpn joined 18:50 jpn left 19:02 librasteve_ joined 19:23 ptc joined
antononcube @Coke Is it a Pepsi? 19:57
19:59 haxxelotto left
lizmat no, Raku Cola! www.hot-clay.com/vitraglaze-raku-g...-cola.html 20:05
jdv i wouldn't drink that 20:12
lizmat and you'd be right! 20:14
antononcube 🙂 🙂 20:24
tbrowder on the Raku rocks 20:27
antononcube @_grenzo Another "Marrow" question/request -- is it a good idea to include a "Raku database" ?
_grenzo Not sure what a "Raku database" is
antononcube Basically, if the fragment in *::db role : given %*ENV<DB_TYPE> { when 'pg' { $.dbh = DB::Pg.new(conninfo => self.conninfo); } when 'sqlite' { $.dbh = DB::SQLite.new(filename => %*ENV<DB_NAME>); } when 'mysql' { die "MySQL not yet supported"; } when 'oracle' { die "Oracle not yet supported"; } when 'raku' { $.dbh = 20:30
::(<Data-access-class>).new() } default { die 'Specify DB_TYPE.'} }
The idea is that instead of using using an SQL DB table we can use a "table" that is a Raku data structure. 20:31
_grenzo As long as it behaves as a DB object...it should work
antononcube I think, this is what the question is: should the adapter just have a .query method, or should there be a "complete" DB::Raku class. (Similar to DB::Pg and DB::SQLite.) 20:33
_grenzo That means it has to be 'interrogate-able' to find the relations
I think I call more than just the query method on the handle. 20:34
antononcube I see. I am thinking that the there is a generic DB-Raku role which has some ad hoc methods for a concrete application with "Marrow".
_grenzo Safest of course is DB::Raku
antononcube Ok, sure. 20:35
20:55 ptc left 22:30 tirnanog joined 23:00 japhb left 23:09 japhb joined 23:46 sena_kun left