🦋 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.
holyghost Iy depends on the implementation though :-) 00:10
*It
holyghost I'm cooking, Blanche waked up, one of my concubine parrot birds 01:43
I had to be more silent ...
anyway, lights out now 01:46
holyghost is going to rest for a while in his bed 01:55
Xliff What's the best way to parse a situation where you have nested tokens? Consider a standard Perl6 block. How would you parse it and all of the blocks under it? 08:02
moritz something like 08:05
token stuff { <-[{}]>* } 08:06
Xliff Yeah, but what if there are blocks inside of <stuff>?
moritz token nested { '{' ~ '}' <stuff> [<nested> <stuff>]* }
Xliff moritz++ 08:07
holyghost Xliff, moritz, I am just writing a tokenizer too :-) 08:10
implementing some java and smalltlk classes in scheme for a irc client with lots of addons
moritz recommends a certain book... 08:11
holyghost moritz : what book do you recommend ? 08:27
moritz holyghost: www.apress.com/us/book/9781484232279 (my own) 08:30
holyghost moritz : thx, I'll look into it later on, I don't have the money to buy it though, I have enough spent on the kids already :-( 08:42
I'm going to see if I can use something from the rebol language in my scheme package 08:43
right now :-)
moritz holyghost: if you give an email address I can send you a copy of the manuscript pre production (so with all the typos still intact :D ) 08:46
holyghost [email@hidden.address] thx 08:47
holyghost I read "mastering regular expressions" 2nd ed. from O'Reilly back in the day 08:48
s/read/had
moritz I've read either the 2nd or 3rd edition. Learned a lot. :D 08:49
moritz and then even more talking grammars with jnthn, pmichaud and TimToady 08:49
holyghost right
I should study it once, I have to reread Programming perl 4th 08:50
I finished the 2nd ed back in the day
in 2000
there's lots of stuff with /g which I don't remember 08:51
regex was perl then not libregex or the usenix libs
\/g for looping I mean
kawaii moritz: just bought a copy :) 08:59
moritz kawaii: thanks :-) 09:09
oh and to everyone who read the books: I'd *really* be happy about (even very short) reviews + ratings on Amazon
those help a lot
(even if you didn't buy through amazon) 09:10
Altreus Red fails its tests, apparently trying to test mysql, which of course I don't have 09:57
should it be skipping or is it a known issue?
Altai-man_ Altreus, creating a ticket would be the best way to know. 09:59
Altreus ya, will do - figured I'd avoid one if I didn't need to ;) 10:00
SmokeMachine Altreus: Red do not have mysql integration yet. isn't it DBIish failing? 10:58
Altreus: could you, please, show me the error? 10:59
JJMerelo The 20th anniversary of the first Perl 6 RFC will be in two weeks raku.org/archive/rfc/1.html 11:25
And we should celebrate.
accordingly
So, I've been thinking that what we could do is write 20 articles, that would pick up one specific RFC (accepted or not), pay homage to the person that created it, and also write a very short article on how it's implemented now in Raku 11:26
We would publish one every day from Aug 1st to Aug 20th
Possibly in the same Advent Calendar blog, because, well, opening a 20th anniversary blog is probably not worth the while. 11:27
I'm going to create a page there, and I'm looking for volunteers.
Failing that, I'll designate you directly :-)
Everyone OK with this?
lizmat sounds like a plan to me! :-) 11:28
Geth_ advent: 271e9dd83e | (JJ Merelo)++ | 20th/README.md
Adds first
11:34
advent: 0c62cd28b8 | (JJ Merelo)++ | 20th/README.md
JJ ignores markdown, news at ten
11:36
JJMerelo So, here's the file github.com/Raku/advent/tree/master/20th Please add yourself for 1, 2 or n slots up to 20. Don't worry if they fill up, we can use backups
Xliff Odd.... why is this not giving me the right set of columns. 12:06
repl.it/@Xliff/DazzlingLinedLocks#main.raku
The first array should be full of "has"
Altreus SmokeMachine: oh yes, you're right, DBIish 12:25
gist.github.com/Altreus/687717dee2...e5a93d8080 12:27
Altreus SmokeMachine: the example you made for kawaii both works and errors for me gist.github.com/Altreus/b99550c403...f679d847f6 13:06
SmokeMachine Altreus: I'll take a look at it after $DAYJOB, sorry 13:08
Altreus right on 13:09
You might be better off pinging kawaii then, since I tend to want to stop coding in the evenings these days :) 13:10
kawaii I'll be around
SmokeMachine ok
Zero_Dogg Is there any way to await two different promises, returning control once *either* has been fulfilled? If I directly "await" two, it waits for both rather than either 15:02
sena_kun Zero_Dogg, Promise.anyof
`await Promise.anyof($p1, $p2)` <-
Zero_Dogg How did I miss that? I've been staring at the docs for Promise… Thanks, sena_kun! 15:04
sena_kun You are welcome.
Voldenet Promise.anyof and Promise.allof don't work like in other languages tho 15:09
m: say await Promise.anyof(Promise.broken("eh")) 15:11
camelia True
timotimo yeah, anyof is just "changed away from `planned`", not "succeeded" 15:13
Zero_Dogg that's fine, I want to timeout an Proc::Async, so I'm checking the state of that afterwards anyway
timotimo as you should :) 15:14
Voldenet the bigger problem with Promise.allof imo is that you don't get results 15:16
timotimo yeah, which is why "await" accepts multiple promises and gives you the results
so that the shorter of the two does what you more likely want and the longer one is more rarely needed, but still accessible
Voldenet that makes sense, it's just not the common convention 15:17
Zero_Dogg raku has been really fun to play around with, lately. Wrote my first code in 2016, but now that it's much more easily accessible it's becoming my go-to 15:18
timotimo what does await with multiple arguments do in other languages? 15:19
Voldenet "invalid syntax" :P 15:22
timotimo ok, so raku had the opportunity to huffmanize and took it :)
rbt @Altreus: Looks like an old DBIish 15:50
Altreus: Zef cached version perhaps? I bet it works if you nuke TempDir StoreDir 15:54
Altreus I already notest installed it :) but I can try another 16:14
timotimo R#2968 16:16
linkable6 R#2968 [closed]: github.com/rakudo/rakudo/pull/2968 Fix RI's from-json creating nested arrays on assign
timotimo m: my @a = from-json '[]'; dd @a 16:17
camelia Array @a = []
Saw 1 occurrence of deprecated code.
================================================================================
Sub from-json (from GLOBAL) seen at:
<tmp>, line 1
Please use JSON::Fast, JSON::Tiny or JSON::Pretty from h…
rbt Altreus: If DBIish 0.6.2 (latest via zef) failed tests I'd like to fix it. 16:24
Altreus rbt: TempDir StoreDir would be .zef/tmp and .zef/store? 16:35
seemed to be enough 16:40
rbt: tested fine, bit noisy though :) 16:41
rbt I think those are the paths it uses. I just do `zef nuke TempDir StoreDir` though and let zef figure it out. 16:44
Altreus ah! tools with valuable functions 16:53
I'm not used to that
SmokeMachine Altreus, kawaii: that should be working now: github.com/FCO/Red/blob/master/t/5...r-update.t 16:58
cpan-raku New module released to CPAN! Red (0.1.22) by 03FCO 16:59
kawaii SmokeMachine: thanks! I'm away from my laptop for the next few hours but I'll test it as soon as possible! 17:00
SmokeMachine kawaii: 👍 17:03
cpan-raku New module released to CPAN! PDF::Tags (0.0.1) by 03WARRINGD 17:24
Altreus SmokeMachine: what's the incantation to set the filename for sqlite?
SmokeMachine Altreus: `$*RED-DB = database "SQLite", :database<./my-database-file.db>` 17:26
Altreus ta
Altreus couldn't find a doc telling me how the database function works :) 17:26
is it just hard to find?
does it need writing?
SmokeMachine Altreus: or `red-defaults "SQLite", :database<./my-database-file.db>` depending on how you are setting your driver 17:27
Altreus: I think it's not written yet, Let me search for it, just a sec 17:28
Altreus red-defaults is a helpful function :)
SmokeMachine Altreus: it's described here... let me see if I can find a more in-depth description 17:29
Altreus: I like even more of red-defaults-from-config github.com/FCO/Red/blob/master/lib...Do.pm6#L21 17:30
Altreus yeah! 17:33
SmokeMachine Altreus: The only other doc I found about that is this one, but it’s not very helpful: fco.github.io/Red/api/Red/Do 17:35
holyghost Just got onto my 1000 lines of scheme 17:57
I'm going to go graphical now with scx (X11 API for scheme), for a sound editor 18:01
SmokeMachine Altreus: is it working? 18:04
kawaii SmokeMachine: works fine on the first cycle (the 'create' part), but 'update' always crashes with a nonsensical error 19:53
www.irccloud.com/pastebin/JqefqVTv/
SmokeMachine: this makes no sense, because it created the entry in the database correctly the first time, but seems on update it tries to put the wrong data in the wrong column, i.e. one of the IDs into the reputation column 19:54
We can
can't get it to output the query it's running either, even with the RED-DEBUG var set
SmokeMachine kawaii: is the new versionll breaking? 19:57
kawaii SmokeMachine: we're using 0.1.22 19:58
SmokeMachine kawaii: it seems to be a biting problem again 19:59
kawaii but you can see here, on update, it tried to set the user-id into the reputation column for some reason :) `value "240882564770955275" is out of range for type integer`
but create works perfectly
SmokeMachine kawaii: is it the same code? I'll try to reproduce 20:01
kawaii SmokeMachine: `.elems ?? .map(*.reputation += 1).save !! .create: :1reputation with Reputation.^all.grep({ .guild-id == $guild.id && .user-id == $reputee-id });`
www.irccloud.com/pastebin/mIhuSz8I/
SmokeMachine: schema ^ 20:02
SmokeMachine I've found the error! the bind order is wrong... 20:11
kawaii ah, 0.1.23 incoming? ^_^ 20:15
SmokeMachine yes... in a few minutes... 20:15
SmokeMachine kawaii: I was "calculating" the binds to the WHERE before the ones to SET... and it only changes something on Pg that uses numbers ($1, $2) instead of simple ? 20:17
I still have to find a way to run tests with Pg... 20:18
kawaii SmokeMachine: how about Docker? 20:21
SmokeMachine kawaii: sorry? what about docker? 20:22
ah! you mean to test it?!
kawaii If you need an environment for running Pg specific tests
yes :)
SmokeMachine I do have Pg installed on my machine... but I'd like a way to run it as CIon GitHub action or RakuDist (like this: github.com/FCO/Red/issues/421) 20:24
kawaii: 0.1.23 should appear any moment now... 20:25
it's already on CPAN
kawaii I'll pull the module source and just use that :) 20:26
SmokeMachine kawaii: on, that's already there, please, let me know if that's working 20:27
kawaii: and thanks for all the bug reports, and to be using Red )
:)
cpan-raku New module released to CPAN! Red (0.1.23) by 03FCO
SmokeMachine ^^ here it is! ) 20:28
:)
kawaii www.irccloud.com/pastebin/o4vsjNy7/
SmokeMachine: perfect :D
SmokeMachine \o/ 20:29
kawaii thank you so much
SmokeMachine kawaii: thank YOU!
kawaii I will be using Red for many more little projects like this in the future, so hopefully we can work to make the library even better now :) 20:29
SmokeMachine kawaii: yes, please! 20:30
kawaii: I hope you enjoy using Red :)
kawaii much nicer than just using DBIish and writing raw SQL :)
even for a small project like this the codebase looks much cleaner
kawaii SmokeMachine: will Red have some kind of driver for working with Redis servers too in the future? 20:31
SmokeMachine kawaii: it was the plan at the beginning... but a lot of things still have to be thought to make that happen. the closest we have about that (yet very far) is this: github.com/FCO/Red-Driver-Cache-Redis 20:33
kawaii: but that's not what you want, and it's still a prototype...
kawaii ah I see, a query cache :) 20:35
Xliff Has any one figured out the best way to get Raku to call function pointers from C? 20:36
Mind you, these are NOT function defs, but function pointer defs. 20:37
kawaii SmokeMachine: one minor thing, `last_updated` is never updated on `update`, do I need to add something to my code? :) very new to this so not sure if I need to add something
kawaii I just need to call DateTime.now whenever that happens, to get the new value 20:37
SmokeMachine kawaii: you could do a trigger on postgres (Red do not support that yet, and that's probable the best solution) or you can add a before-update Red phaser 20:40
kawaii: github.com/FCO/Red/blob/master/doc...md#phasers 20:41
kawaii: something like `method !update-time is before-update { self.last_update .= now }` should work 20:43
kawaii I'll try that soon 20:44
SmokeMachine I mean: method !update-time is before-update { self.last-update .= now }
no, that'll not work with your code... :( 20:46
that only works for loaded objects, and with that code you never load an object. :( 20:47
cpan-raku New module released to CPAN! Random::Names (0.0.1) by 03ELIZABETH 20:51
kawaii SmokeMachine: not too important right now, and time for me to stop programming today, thanks for all your help though :) 20:54
SmokeMachine kawaii: to use that, you'll probably need to do something like: www.irccloud.com/pastebin/KF1bEDSf/ 20:55
kawaii: but that will be easier whe we have the create or update 20:56
does anyone have a suggestion of how a create or update should look on Red? 20:57
SmokeMachine kawaii: I think I've found a way to make the before-update phaser run on ResultSeq updates also... :) 21:20
Petr37 can anyone recommend good Raku book ? 21:31
timotimo take a perl 6 book and pretend where-ever it says "perl 6" it means raku :) :) 21:33
i don't actually have a suggestion or recommendation
holyghost Petr37 : I have "Think Perl6", which is a bit old since raku but a good read, not too difficult (and there's scheme language features in it, hyphens) 21:36
kawaii SmokeMachine: I will have plenty of time to test tomorrow :) 21:37
holyghost You cannot program set! or nil? in raku though 21:38
timotimo what do these two functions do? i assume `nil?` checks if something is Nil?
and `set!` does what? like assignment? 21:39
holyghost I mean you cannot use a ! or ? in raku's syntax, not the native scheme code you mentioned 21:40
in lisp and scheme you can
timotimo unless you use Slang::Piersing
cpan-raku New module released to CPAN! Random::Names (0.0.2) by 03ELIZABETH 21:46
rypervenche Petr37: raku.guide/ is very good, if you're looking for a good site. 21:48
oddp Also, some of Shitov's material is free. 21:51
holyghost I'm going to buy "a programmer's guide to sound" for my scx sound system 21:54
Tim Kientzle 21:55
TBH
it was mentioned on stackoverflow
20$ used
including shipping
I have an electro group called "Lost Momentum", I only have one song in the making though, a remix 21:56
Involves lots of time 21:57
I hate my mouse for it :-)
Petr37 rypervenche, thanks. i read them all. 22:00
SmokeMachine now Red can use before-update on ResultSet updates! :) 22:23
SmokeMachine .tell kawaii now this works: www.irccloud.com/pastebin/uVZiQ0Da/ 22:29
tellable6 SmokeMachine, I'll pass your message to kawaii
cpan-raku New module released to CPAN! Red (0.1.24) by 03FCO 22:36
cpan-raku New module released to CPAN! Hash2Class (0.0.3) by 03ELIZABETH 22:59
tbrowder lizmat: \o/ beat me to it again--nice class-maker! 23:04
lizmat tbrowder: now with a class skeleton generator that takes a JSON file 23:05
lizmat to make life easier :-) 23:05
enough for today.. &
tbrowder g'nite.., 23:06
lucs wonders in what tense was "i read them all" intended... 23:08