• cheeser
  • ernimril
  • joed
  • kinabalu
  • lunk
  • ojacobson
  • r0bby
  • ThaDon
  • ricky_clarkson
  • topriddy

« 2020-07-08


2020-07-10 »

Nick Message Date
OliverMT cheeser: context to above statement? :) [01:19]
OliverMT Irccloud went down [01:19]
OliverMT But I am intrigued [01:19]
cheeser to ... what? [02:00]
Ladicek [Ladicek!~lthon@] has joined #kotlin [02:12]
OliverMT [OliverMT!sid16701@gateway/web/] has joined #kotlin [02:55]
madflavor [madflavor!sid99242@gateway/web/] has joined #kotlin [02:55]
kupi [kupi!uid212005@gateway/web/] has joined #kotlin [02:58]
LyndsySimon [LyndsySimon!sid34452@gateway/web/] has joined #kotlin [04:09]
tga [tga!~tga@unaffiliated/tga] has joined #kotlin [04:57]
tga greetings [04:57]
tga is kotlin native a good alternative to golang for packing a web app into a standalone static binary? [04:59]
Jonopoly [Jonopoly!~Jonopoly@unaffiliated/jonopoly] has joined #kotlin [05:03]
OliverMT cheeser: 21:53:18 <cheeser> don't use mocks [05:41]
OliverMT tga: [05:41]
OliverMT ahh kotline NATIVE [05:41]
OliverMT sorry, didnt see that word [05:42]
tga yeah, I definitely can't expect or install a jre [05:56]
OliverMT have you looked at fat jar into graalvm into native? [05:59]
tga I was hoping someone else had already tried it [06:09]
raoul11_ [raoul11_!~raoul11_@unaffiliated/raoul11] has joined #kotlin [06:30]
raoul11_ [raoul11_!~raoul11_@unaffiliated/raoul11] has joined #kotlin [06:33]
jacob [jacob!~jacob@unaffiliated/jacob] has joined #kotlin [06:52]
Lengsdorfer [Lengsdorfer!~Lengsdorf@unaffiliated/lengsdorfer] has joined #kotlin [07:17]
jacob [jacob!~jacob@unaffiliated/jacob] has joined #kotlin [07:39]
argo [argo!~argo@unaffiliated/argo] has joined #kotlin [07:46]
veegee [veegee!] has joined #kotlin [08:06]
MassDebates [MassDebates!~MassDebat@unaffiliated/massdebates] has joined #kotlin [08:18]
argo [argo!~argo@unaffiliated/argo] has joined #kotlin [08:47]
madprops what's the point of the component functions here? [08:58]
madprops why can I just access 'first' and 'second' normally? [08:58]
madprops can't * [08:58]
madprops or I mean, component1 and component2 [09:12]
madprops oh it's because it's not a data class I think [09:13]
Bombe The component* functions are needed for the destructuring declaration in line 12. [09:32]
cheeser right [09:32]
cheeser data classes give you those for free. otherwise you have to write them manually. [09:33]
orbyt_ [orbyt_!~orbyt@] has joined #kotlin [10:07]
DarkUranium [DarkUranium!] has joined #kotlin [10:29]
t0m3k [t0m3k!] has joined #kotlin [10:30]
ridcully [ridcully!] has joined #kotlin [10:43]
OliverMT anyone got an idea how to solve my catch-22 of generated files? I don't want to use maven because it's such a chore to read external envs, so I have set up a programmatic runner that I can configure with a proper Properties or other means of config [11:16]
OliverMT what I want to do, is have a single kotlin file that has access to my maven deps, but is not compiled / tied to main project [11:16]
cheeser a chore to what? [11:16]
OliverMT jooq.xml external config doesn't even support it [11:16]
OliverMT so I have to embed jooq into main pom [11:16]
OliverMT and IDEA env vars in maven runner dont work properly, so I need to actually set windows env vars for it to be picked up [11:17]
cheeser sounds like you're doing things wrong and blaming maven [11:17]
OliverMT hehe [11:17]
OliverMT the general mood seems to frown upon using env vars in maven [11:17]
OliverMT which is very weird, because database name and user/pw is not what I would consider system altering variables [11:17]
OliverMT I am also looking at a outside of git [11:18]
OliverMT so each person checking it out can just make one or copy from (which has the defaults) [11:18]
OliverMT but either way, I would like to know if I can have a kotlin file outside the main module that uses the maven deps [11:18]
OliverMT but I can run it without the main project being able to compile [11:19]
OliverMT the whole thing is a bit moot now either way, because we decided we want the table classes to live in git [11:19]
OliverMT but in a general manner I would like to understand maven well enough to see if what I want to do is possible (run a separate project in idea that isnt affected by compile errors in another module) [11:19]
tang^ [tang^!~tang^] has joined #kotlin [11:25]
KeyJoo [KeyJoo!~KeyJoo@] has joined #kotlin [11:52]
dmabs [dmabs!~dmabs@unaffiliated/dmabs] has joined #kotlin [11:54]
yawkat OliverMT: you can have a different profile with different compiler config i guess, but it's highly non-standard [12:00]
raoul11_ [raoul11_!~raoul11_@unaffiliated/raoul11] has joined #kotlin [12:17]
madprops are the '?' meant only for programmer's awareness? [12:27]
madprops or is there some practical use [12:27]
madprops apart from the (if x != null) shortcuts [12:38]
madprops I mean like obj?.prop [12:39]
cheeser [12:43]
cheeser cheeser's title: "Null Safety - Kotlin Programming Language" [12:43]
funeral [funeral!~Funeral@2a01:799:7e0:1000::80d] has joined #kotlin [12:47]
Suchorski [Suchorski!~regex@unaffiliated/suchorski] has joined #kotlin [12:49]
ChrisLane [ChrisLane!] has joined #kotlin [01:02]
madprops "chain returns null if any of the properties in it is null." [01:13]
madprops nice [01:13]
madprops kindof weird that it's not possible to define an 'else' in ?.let {} [01:17]
madprops "if it's null then do this" [01:17]
madprops though I guess that wouldn't make sense since let uses the 'it' reference [01:19]
ridcully madprops: maybe you are looking for the elvis operator? [01:21]
madprops oh I was just about to start reading on that haha [01:22]
zutat [zutat!02f39919@unaffiliated/zutat] has joined #kotlin [01:25]
madprops elvis seems to be used for quick values [01:26]
madprops can't seem for instance use a { } function on else [01:26]
madprops but I can just use a normal if [01:26]
cheeser foo?.let { } ?: blah() [01:27]
madprops that works, with one liners on the else side at least (no { .. } ) [01:31]
ChrisLane [ChrisLane!] has joined #kotlin [01:31]
cheeser huh? [01:31]
madprops I mean something like this [01:32]
madprops (ignore the p(1) bit, that's a custom function) [01:32]
cheeser that should work [01:33]
madprops I get: Type mismatch: inferred type is () -> Unit but Unit was expected [01:34]
ridcully lacks the call in the else branch? [01:34]
cheeser [01:35]
cheeser yeah. you need to invoke it [01:35]
cheeser [01:36]
orbyt_v7 [orbyt_v7!~textual@] has joined #kotlin [01:36]
cheeser either works [01:36]
madprops on the second link I get "Code exceeded the maximum allowed running time" when I hit "Run" [01:37]
cheeser rerun it [01:38]
madprops same result [01:38]
madprops if i change it to .invoke() it works [01:39]
madprops ok it worked this time with () [01:40]
cheeser it ran for me earlier [01:40]
jenia [jenia!] has joined #kotlin [01:46]
jenia I'm trying to use Guava in my Kotlin project [01:46]
jenia I need to do this: `Cache<Key, Value> cache = CacheBuilder.newBuilder().build()` [01:47]
jenia How would you write that in Kotlin? [01:47]
cheeser val cache = CacheBuilder.newBuilder().build() [01:48]
jenia no but it needs the parametrized types [01:48]
jenia `<Key, Value>` [01:48]
cheeser maybe something like this: [01:49]
cheeser val cache = CacheBuilder.newBuilder<Key, Value>().build() [01:49]
cheeser depends on how those methods are defined. [01:49]
cheeser or you could use an explicit type and perhaps inference would take care of it on the RHS [01:50]
jenia Ok gotcha. Thanks!! [01:51]
OliverMT I just chuckled at a tweet earlier today, paraphrased something like "you're not a jave dev if you don't sit down to remove Guava from something now and then" [02:21]
jenia is there some kind of a hashmap in Kotlin when you can specify that max-size as well as a pruning mechanism (you know, TTL) [02:23]
yawkat not in the stdlib no [02:25]
yawkat but theres better cache libraries like caffeine [02:25]
jenia ok. thanks [02:25]
jenia is it good practice to mix Java and Kotlin libraries? [02:26]
jenia Kotlin code with Java libraries [02:26]
nathanj [nathanj!~nathanj@] has joined #kotlin [02:27]
yawkat sure [02:28]
flatmap [flatmap!] has joined #kotlin [02:38]
flatmap what makes GlobalScope.launch special so that threads lauched with it seem to run independently in the background? any other dispatcher type seems to not own that behavior [02:39]
zutat that's a scope, not a dispatcher [02:41]
flatmap oh well yes ... [02:43]
flatmap so what is the special sauce that makes coroutines run with this scope run like daemon jobs? [02:43]
jenia what's the syntax to pass an function to another fun? [02:44]
jenia like f(x, fun() {}) [02:44]
zutat f(x, ::fun) [02:45]
flatmap or pass a lambda f(x, { /* lambda */ }) [02:47]
flatmap the last param can be placed outside the braces [02:47]
flatmap f(x) { /* lambda */ } [02:47]
flatmap [flatmap!] has joined #kotlin [02:58]
liefer [liefer!~liefer@unaffiliated/liefer] has joined #kotlin [03:05]
liefer [liefer!~liefer@unaffiliated/liefer] has joined #kotlin [03:08]
liefer9 [liefer9!~liefer@unaffiliated/liefer] has joined #kotlin [03:12]
flatmap [flatmap!] has joined #kotlin [03:25]
jenia [jenia!] has joined #kotlin [03:33]
jenia hello. How do I convert this to Kotlin: [03:34]
jenia jenia's title: "CachesExplained google/guava Wiki GitHub" [03:34]
yawkat you can paste java code into intellij and it converts for you [03:34]
jenia amazing!! [03:34]
jenia thanks [03:34]
flatmap [flatmap!] has joined #kotlin [04:43]
t0m3k [t0m3k!] has joined #kotlin [04:54]
shicks2525 [shicks2525!] has joined #kotlin [05:04]
wymillerlinux [wymillerlinux!] has joined #kotlin [05:07]
niceplace [niceplace!~nplace@] has joined #kotlin [05:18]
Arimil [Arimil!] has joined #kotlin [06:42]
liefer [liefer!~liefer@unaffiliated/liefer] has joined #kotlin [09:32]
orbyt_ [orbyt_!~orbyt@] has joined #kotlin [10:40]
jdlee [jdlee!~quassel@unaffiliated/littlezoper] has joined #kotlin [10:41]