[swift-evolution] Proposal: An assignment operator := that ensures nil before assignment.

Ross O'Brien narrativium at gmail.com
Sat Feb 27 10:19:48 CST 2016


The justification for assertions in general is unnecessary. Swift already
has assertion functions: "assert" and "precondition" (even though it's
still not clear to me why we have two of them). This thread isn't about
software assertions.

This thread is about your := assertion operator. This thread *is* the
exploration of it, as it relates to Swift. You think it would be worth
including in Swift? Then argue its case. Tell us why := is useful. Provide
a code sample of one of the situations you think it would be used so often
for. Show us the value.

Don't expect us to do all the work here. Your suggestions lack sufficient
information to make their worth obvious to us. At the moment you're not
convincing us that you've thought about your proposal enough to even decide
if it was worth pitching, before you pitched it. Please make that effort.

On Sat, Feb 27, 2016 at 4:10 PM, Amir Michail via swift-evolution <
swift-evolution at swift.org> wrote:

>
> > On Feb 27, 2016, at 11:07 AM, Stephen Celis <stephen.celis at gmail.com>
> wrote:
> >
> >
> >> On Feb 27, 2016, at 10:57 AM, Amir Michail <a.michail at me.com> wrote:
> >>
> >>> On Feb 27, 2016, at 10:39 AM, Stephen Celis <stephen.celis at gmail.com>
> wrote:
> >>>
> >>>> On Feb 27, 2016, at 10:38 AM, Amir Michail <a.michail at me.com> wrote:
> >>>>
> >>>> I think this := would be used so often that it should be part of the
> language/standard library.
> >>>
> >>> Would you please justify this? Would you please answer the questions
> from my reply?
> >>
> >> See: http://research.microsoft.com/apps/pubs/default.aspx?id=70290
> >
> > See what part? This document provides no justification for any kind of
> assignment/assertion operator. Please provide additional context around
> links you share and how they relate to your actual proposal.
>
> The justification for assertions in general is empirical and the Microsoft
> paper provides it.
>
> To explore how useful := assertions are in particular would need a study
> like the Microsoft one that focuses exclusively on := assertions.
>
> >
> > In this case your proposal still needs justification. Would you, again,
> please answer these questions to provide it?
> >
> > - Why do you want this feature?
> >
> > - Would you please provide a better, real-world example (perhaps code
> extracted from a real-world project you've worked on that would benefit)
> that demonstrates the benefits of your suggestion?
> >
> > - Can you go into more detail on the the design of the proposal? How it
> may be implemented? Caveats? Alternatives considered?
> >
> > --
> > Stephen
>
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160227/b36e8445/attachment.html>


More information about the swift-evolution mailing list