[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: [OT] Swiftly return multiple values
- From: steve donovan <steve.j.donovan@...>
- Date: Tue, 3 Jun 2014 12:06:19 +0200
On Mon, Jun 2, 2014 at 10:24 PM, Elias Barrionovo
> Well, it's a bit OT and nitpicking, but in Python when you do this:
> def foo(a, b):
> return a, b
> you are actually returning only one value, (a, b), which is an
> instance of tuple  (parenthesis is optional for tuple literals).
And that's the point - it's more expensive than it looks. True
multiple returns in Lua and Go are cheap. (In both languages, often
used for distinct error returns)
That's why I prefer Lua to Python - there is less 'convenience magic' happening.
As for Swift - it's fashionable for big companies to have their own
new programming language. A well-known advertising agency  has
spawned at least two recently. Despite its oddities, Swift seems a lot
more readable than Objective-C, which always made my eyes bleed.
 Google (Go and Dart)