Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Swift REPL

DZone's Guide to

Swift REPL

· Java Zone
Free Resource

Bitbucket is for the code that takes us to Mars, decodes the human genome, or drives your next car. What will your code do? Get started with Bitbucket today, it's free.

A Read-eval-print-loop (REPL) is a simple program that takes input and immediately gives user feedback. The new language from Apple, Swift comes complete with its own REPL shell. To use it follow these simple instructions in a terminal. This is assuming you already have Xcode6 installed.

  1. $ sudo xcode-select -s /Applications/Xcode6-Beta2.app/Contents/Developer/
    Change the path to point to the version of Xcode you have installed

  2. $ xcrun swift

  3. Now should be in Swift's REPL and you can type commands that will be instantly executed.

$ var a = "hello"
$ println(a)

Happy REPL-ing!

Bitbucket is the Git solution for professional teams who code with a purpose, not just as a hobby. Get started today, it's free.

Topics:

Published at DZone with permission of Ricky Yim, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}