🦋 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.
tbrowder i think i'll put it on rosetta code as is. anyone can modify it as needed. 00:06
Geth ¦ problem-solving: vrurg assigned to jnthn Issue FQN method calls may need clarification github.com/perl6/problem-solving/issues/129 01:45
El_Che SmokeMachine: It's not clear from the github page of Red supports Mysql/MariaDB. Does it 10:26
SmokeMachine: It's not clear from the github page of Red supports Mysql/MariaDB. Does it?
SmokeMachine it doesn’t yet...
El_Che: ^^
El_Che: but it’s just a question of creating a new driver... 10:27
El_Che SmokeMachine: thank you. (Our admins guys only have Mysql and Oracle clusters running)
SmokeMachine: looking at the SQLlite one. Not sure if I get what it does :) 10:28
SmokeMachine: so the driver for sqllite is completely implemented in SQLiteMaster.pm6 and SchemaReader.pm6? 10:29
No binary libs linked somewhere? 10:30
SmokeMachine El_Che: no, its implemented here: github.com/FCO/Red/blob/master/lib...SQLite.pm6
El_Che: those 2 classes are just to given a db, read it and create new models... 10:31
El_Che so this: github.com/perl6/DBIish (and nativecalls)
got it
SmokeMachine the driver itself is this file I’ve sent you...
El_Che the driver is kind of the interface with DBIish 10:32
like DBI/DBM thing in P5
SmokeMachine Yes… this and a way to translate the AST specific to that database...
El_Che you wrote a lot of code, Red is pretty big 10:33
SmokeMachine++
SmokeMachine El_Che: but most of the translation (the SQL commom part) is implemented on CommonSQL...
:)
Yes… it’s getting big… but it’s still far from complete… :( 10:34
El_Che SmokeMachine: only browsing the code (too busy as it's the end of the planning cycle at work), but it's pretty impressive so far
SmokeMachine El_Che: :) thanks 10:35
El_Che in the code I see:
Person.^create-table;
why the ^?
SmokeMachine It’s a meta-method call...
El_Che yeah, why not a regular method I mean
SmokeMachine Red do not add any method on your model...
El_Che I see 10:36
nice of you :)
got to go, ad hoc meetign
SmokeMachine As in a class, you have to call .^attributes to get the attributes, in a model you have to call .^columns to get the columns... 10:37
and you need to use meta-methods for everything that touches the database...
kawaii Hi, I'm using IO.watch to check for new files being created on a filesystem, but it seems that it doesn't check recursively within any subdirs of the path I've given it, any ideas? :) www.irccloud.com/pastebin/HFBm8Jv7/ 14:25
it only searches the root of my `%configuration<geotrack-filepath>` 14:26
vrurg kawaii: This limitation partly comes from libuv too: docs.libuv.org/en/v1.x/fs_event.html 14:37
But MoarVM doesn't set the recursive flag anyway. Perhaps, it should be optional. 14:42
kawaii vrurg: any hacky workaround to maybe detect all of the directories contained within a path and set up an array of event listeners? 14:43
:)
vrurg kawaii: same could be achieved in Raku too. BTW, I might have seen something like this in a module. Could a deja vu though. 14:46
jnthn vrurg: I think there's maybe a module; Cro certainly has code to do it also that could be borrowed 15:47
uh, kawaii ^^ :) 15:48
It was hard enough to get right that I sometimes wonder if we shouldn't provide for it in core...
vrurg jnthn: why not provide optional support for UV_FS_EVENT_RECURSIVE in moar? IO::Notifications could then make use of it and bail out on unsupported yet platforms. 15:51
vrurg is afk 15:52
kawaii jnthn: if you could point me in the rigth direction that would be great :) 15:53
I have a directory which then has a dozen or so subdirs, and I need to monitor each one for new files
jnthn There's even github.com/croservices/cro/issues/48 for it 15:55
github.com/croservices/cro/blob/ma...s.pm6#L159 is the code you're after 15:56
kawaii jnthn: that seems to accept a hash of dirs, can we not do it dynamically? 15:58
jnthn It takes an IO::Path? 15:59
`sub watch-recursive(IO::Path $path) {` 16:00
kawaii oh right I read it wrong, yes I see now
kawaii jnthn: seems like I can't just hot-swap it in my code `whenever %configuration<geotrack-filepath>.watch-recursive -> $event` 16:09
`%configuration<geotrack-filepath>` is a Str, a path
` No such method 'watch-recursive' for invocant of type 'Str'` 16:10
jnthn If you just copied it, then it's a sub, so you'd need to use .&watch-recursive
But you'll also need to coerce to an IO path too (.IO) 16:11
You'd have to do that to call .watch though...
kawaii I just added a `use Cro::Tools::Services;` to my code because lazy
hey I got it working! 16:14
thanks jnthn!
jnthn :) 16:16
Xliff o/ 22:26
What's the best way to define a conditional constant?
m: my $a; BEGIN { $a = 1; }; constant B := $a; B.say 22:27
camelia 1
Xliff m: my $a; BEGIN { $a = 2; }; constant B := $a; B.say
camelia 2
Xliff my $bits := BEGIN $*KERNEL.bits == 32 ?? uint32 !! uint64; our constant Pid is export := $bits; Pid.say 22:28
evalable6 (Any)
Xliff my $bits := do BEGIN { $*KERNEL.bits == 32 ?? uint32 !! uint64 }; our constant Pid is export := $bits; Pid.say
evalable6 (Any)
Xliff my $bits; BEGIN { $bits = $*KERNEL.bits == 32 ?? uint32 !! uint64 }; our constant Pid is export := $bits; Pid.say 22:29
evalable6 (uint64)
Xliff my $bits; BEGIN { $bits := $*KERNEL.bits == 32 ?? uint32 !! uint64 }; our constant Pid is export := $bits; Pid.say 22:30
evalable6 (Any)
Xliff Wow! Can't bind? Huh
elcaro how do I query which version of a module I have installed 23:29
eqv to perl5's $Module::Name::VERSION