• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Swift Question: Tuple Return Types
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Swift Question: Tuple Return Types


  • Subject: Swift Question: Tuple Return Types
  • From: Mike Ellard <email@hidden>
  • Date: Thu, 26 Feb 2015 13:24:56 -0800

Functions / Methods / Closures that return more than one item can use a tuple to do so.

Functions / Methods / Closures that return zero items use an empty tuple to do so, notated as () or Void.

A tuple that contains a single item is treated as having the type of the item it contains.  For example, (Int) and Int can be used interchangeably.

So here’s my question:  Is it correct to say that every function / method / closure returns some sort of tuple, including functions / methods / closures that return a single item?

Sincerely,

Michael Patrick Ellard






 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


  • Follow-Ups:
    • Re: Swift Question: Tuple Return Types
      • From: Marco S Hyman <email@hidden>
  • Prev by Date: Re: Blacklisted Spotlight importer plugin
  • Next by Date: Re: Swift Question: Tuple Return Types
  • Previous by thread: Re: Blacklisted Spotlight importer plugin
  • Next by thread: Re: Swift Question: Tuple Return Types
  • Index(es):
    • Date
    • Thread