[swift-evolution] Add an ifPresent function to Optional

Dmitri Gribenko gribozavr at gmail.com
Mon Mar 14 17:33:27 CDT 2016


On Mon, Mar 14, 2016 at 1:28 PM, Erica Sadun via swift-evolution
<swift-evolution at swift.org> wrote:
>
>> On Mar 14, 2016, at 2:18 PM, Daniel Vollmer via swift-evolution <swift-evolution at swift.org> wrote:
>>
>> Hi,
>>
>>> On 13 Mar 2016, at 18:04, Erica Sadun via swift-evolution <swift-evolution at swift.org> wrote:
>>>
>>> I am in favour of making optionals consistently act like 1-item-max collections.
>>
>> Why stop there? Why not make all non-optionals collections of one?
>
> I don't quite see what advantage would that have. Could you elaborate?

I think that's exactly Daniel's point, that it would be absurd to do so.

Dmitri

-- 
main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
(j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr at gmail.com>*/


More information about the swift-evolution mailing list