#rust

/

      • nox
        A static variable is a module item,
      • mindtree has quit
      • a local variable isn't.
      • Douman
        well... type inference isn't magic usually
      • zofrex
        and there's a few other places where you have "let _ ="
      • I would try to remove all of those. and if any of them complain about needing to use a Result, then you know you're missing some other error handling :)
      • fwiw
      • nox
        hexagoxel: Where is the Chan type to receive the answer in that example?
      • Isn't type ascription going to not stabilise?
      • cscorley joined the channel
      • hub joined the channel
      • On arbitrary expressions I mean.
      • simonoram has left the channel
      • dowwie joined the channel
      • Douman: I didn't say it is magic, I'm just saying the types are mandatory for clarity purposes.
      • Douman
        well i don't get how being module item changes need for clarity
      • Ketsuban_ has quit
      • nox
        How do you make a public local variable?
      • staticassert joined the channel
      • hexagoxel
        nox: the answer goes in the MVar.
      • bowersbros
        zofrex I'll take a look into what rx.recv can give me, but im receiving no compiler warnings or errors
      • Douman
        you cannot make public local variable cuz it is on stack usually
      • bowersbros
        ah it isnt warning because _ => continue
      • glyne joined the channel
      • Douman
        nox: leaving clarification of type to Rust seems rather reasnoable except maybe for case with integers
      • italic has quit
      • yuja has quit
      • nox
        Douman: Well we can indeed disagree on that.
      • allight has quit
      • Fishrock123 joined the channel
      • hexagoxel: I don't see how that is more convenient or clearer, but sure.
      • Douman
        i still don't get what makes static so different ;(
      • or const
      • nox
        Douman: For the same reason that you can let rustc infer argument types on lambdas but not functions, or methods,
      • etc.
      • Douman
        um... and reason is...?
      • dpyro joined the channel
      • nox
        The discussion is going in circles. Said it twice: clarity. For example documentation purposes when reading the code.
      • quodlibetor joined the channel
      • Double checking that this is actually what you mean, etc.
      • Douman
        if clarity is reason then you should just said so. i thought you meant some actualy reasoning behind it
      • bowersbros
        zofrex Im not sure if i would need to / how i would handle the error in rx.recv
      • Douman
        got it
      • bowersbros
        I cant find what would cause it to error
      • in their documentation
      • glyne has quit
      • zofrex
        bowersbros: you're doing "while let Ok(event) = rx.recv()"
      • Morten has quit
      • bowersbros
        Ah
      • shatur joined the channel
      • cholcombe joined the channel
      • zofrex
        so if recv() returns an error the while loop will end, the method will return, and the program will exit - silently
      • I think
      • zeryx joined the channel
      • deadc0de has quit
      • deadc0de joined the channel
      • bluss has quit
      • hexagoxel
        nox: but the session_types implementation requires macro usage, right?
      • mib_ntk7od joined the channel
      • bowersbros
        Ok, so how would i be best off handling it instead of while let?
      • hexagoxel
        that the types represents "Add, Negate, Sqrt, Eval" is added in a bloody comment instead of being first-class. this is not clear in my opinion.
      • ciniglio has left the channel
      • bowersbros
        just loop { match {} ?
      • mib_ntk7od has quit
      • zofrex something like this? http://pastebin.com/2Y1fPA6w
      • deadc0de has quit
      • allight joined the channel
      • edrocks joined the channel
      • bennofs
        Does somebody know a crate like "error_chain", but that does not have stringly-typed error messages?
      • ytain joined the channel
      • I think error-chain is almost perfect, except for it's ability to also produce errors from strings :(
      • asm has quit
      • hexagoxel
        nox: of course the important part is what the users sees, and she will neither see the MVar nor the details of the Srv type.
      • Levex joined the channel
      • deadc0de joined the channel
      • nox
        bennofs: What do you mean?
      • Quxxy2 has quit
      • tylerhardin joined the channel
      • hexagoxel: I don't do much Haskell, I just don't see how GADTs and existential types help to make something similar to session types to describe a protocol. I would appreciate some docs about that though
      • bennofs
        nox: all error types produced by error-chain automatically have a Custom constructor that provides a way to make an error out of an arbitrary String
      • nox: afaic
      • nox: i would like a way to disable that, so that I can be sure that all my errors are an enum variant, not simply a string
      • cpup has quit