Thread
#multiplatform
    a

    Alfred Lopez

    1 year ago
    So....is there a Kotlin equivalent to System?
    b

    Benjamin Charais

    1 year ago
    In Multiplatform if you want access to system, you would need to use expect/actual and then for each target make a specific implementation of the functionality for that individual System.
    a

    Alfred Lopez

    1 year ago
    k. Thanks!
    b

    Benjamin Charais

    1 year ago
    Feel free to reach out for more info 🙂
    a

    Alfred Lopez

    1 year ago
    [waving hand] This is not the answer I was looking for.....
    🙂
    Well, not what I was expecting
    b

    Benjamin Charais

    1 year ago
    Sadly… I feel the same, a few months ago I had to create “File” representations for 3 targets
    a

    Alfred Lopez

    1 year ago
    I'm in the same boat, but I'm using Korlabs korIO package
    ian.shaun.thomas

    ian.shaun.thomas

    1 year ago
    still early days, quite a few things are missing that are kind of critical near term like Date, Locale, File and general IO, knowing details about the host such as some of what System provides.
    a

    Alfred Lopez

    1 year ago
    I don't know if it actually works. I'm still coding against it
    b

    Benjamin Charais

    1 year ago
    I looked at theirs, I cant recall what about it that didn’t fit our usecase.
    a

    Alfred Lopez

    1 year ago
    Lack of docs
    I have to read the test apps to figure out how to use it
    Much less, understand what they do
    But, I'm desparate
    b

    Benjamin Charais

    1 year ago
    What functionality do you need?
    a

    Alfred Lopez

    1 year ago
    I need to read properties files
    for starters
    I've completed the implementation with that lib, but now I'm facing the System issue
    since I need to read the environment vars
    But, perhaps I'll forego that aspect
    b

    Benjamin Charais

    1 year ago
    If you need env… would it be better to handle that through gradle at compile time?
    a

    Alfred Lopez

    1 year ago
    I need it at runtime, unfortunately
    We have Java, Node and mobile platforms and I need to create a lib that works on all of them
    I chose Kotlin because of "the promise", but I didn't realize that it can with "baggage"
    But all's good
    ian.shaun.thomas

    ian.shaun.thomas

    1 year ago
    what I've done for those situations is use registration systems where the runtime can provide implementations that provide that information since System reading env variables breaks down in certain runtimes like JS web. In that kind of case, it doesn't necessarily make sense to use expect/actual if it likely can't have a reasonable actual on every target.
    interfaces rather than expect/actual
    a

    Alfred Lopez

    1 year ago
    Yeah, I just thought about that, but since I know this will only run in NodeJS (as well as JVM), I can use Node's process.env object