• 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
very simple swift question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

very simple swift question


  • Subject: very simple swift question
  • From: email@hidden
  • Date: Tue, 24 Feb 2015 13:34:38 -0800

I'm just starting Swift, and using a book (Swift for Programmers) that has this example code in it:

let number1 = 45
let number2 = 72
let sum = number1 + number2
...

But this gives me an error on the third line, saying "Consecutive statements on a line must be separated by a ';'."

I know I could use a var instead of a constant, initialize it to number1 and then add number2 separately, but shouldn't the above code be legal? Is this something that changed in Swift since that book came out? (I am using the new beta build of Xcode 6.3, which I think has an updated Swift version.)

Thanks,
  Howard
_______________________________________________
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: very simple swift question
      • From: email@hidden
  • Prev by Date: Re: Swift Framework in a Swift MacOSX Application
  • Next by Date: Re: very simple swift question
  • Previous by thread: Re: Swift Framework in a Swift MacOSX Application
  • Next by thread: Re: very simple swift question
  • Index(es):
    • Date
    • Thread