[Swift-devel] Changes to array closing semantics?

Ben Clifford benc at hawaga.org.uk
Thu Nov 22 11:49:15 CST 2012


On Thu, 22 Nov 2012, Tim Armstrong wrote:

> I'm not sure if there a way to help users with potentially counter-intuitive behaviour, like a compiler
> warning - aside from maybe documenting and explaining it better.

My opinion (still) is that getting rid of piecewise assignment is the 
thing to do.

The notation is initially appealing because you can say to users "yeah, 
its just like in fortran/c/java".

But then you start loading on all this stuff about "oh mind you don't do 
this"; and on the implementation side you have to implement stuff to 
detect when these rules are broken; and its bandaid after bandaid, year 
after year.

I think that syntax is always going to allow you to write something 
surprising - get rid of it!

People pay me money to write haskell for them now, so I'm even more 
opinionated about it than before. In doing so I've also come to realise 
that using [] for reading is probably fine; its really the piecewise 
construction in this fashion that is the problem.

ps aren't you all meant to be eating turkey?

-- 




More information about the Swift-devel mailing list