On Tue, Nov 18, 2014 at 3:32 PM, Nevin Liber
On 18 November 2014 07:30, pfultz2
wrote: I see. In this case I agree in that the original optional should remain the same. However, I don't see much point in such a restricted subset of the current optional. Just imagining myself using functions/lambdas instead of get() and similar code makes me dizzy.
I sympathize with your opinion. Personally, I also prefer the current way of accessing the value. Yet, I see people complain that it is unsafe. It is my hypothesis that there exist a portion of users that just like the monadic interfaces along with the inconvenience that comes with it. This post is to confirm my hypothesis, and if it is the case, to satisfy the demand.
Another option I would like to see is for `optional` to implement a range.
+1.
Why? It doesn't make a very useful/interesting range, does it? (Unless you agree with Sean that everything should be range-able, ie an int denotes a range of one int. Agreeing with Sean _is_ a strong argument :-) I think the range-for-loop lacks clarity here. I worry that optional having "multi-paradigm" is harmful - since it can't do all of them without compromise. Tony