On 12/07/2013 10:53 AM, Simon Sapin wrote:
On 07/12/2013 01:07, spir wrote:
Maybe it's only me, but this not at at all clear to my eyes. My imagined soluton
(for a totally different lang) was something like this, on the caller side:

    ucodes = s.utf8_decode()!    // source should be correct, error on failure
      ucodes = s.utf8_decode()?    // logical failure expected, return None or
whatnot


This is interesting, but I’d like to discuss what to do in this particular
language, Rust that is trying to go to 1.0 and will probably not accept such
syntax change :)


You are right, indeed! ;-)
But the issue exists anyway... dunno about solution. In fact we'd ned to invert the logic: instead of:
        x = foo()               // Option element wrapping possible result
        x = foo().unwrap()      // bare result
think:
        x = foo().option()      // Option element wrapping possible result
        x = foo().direct()      // bare result
or even
        x = foo()               // bare result

Denis
_______________________________________________
Rust-dev mailing list
Rust-dev@mozilla.org
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to