title: Swift REPL: how to import, load, evaluate, or require a .swift file?
body: <p>In the Swift REPL, how to import (a.k.a. load, evaluate, require) a typical text *.swift file?</p>
  
  <ul>
  <li><p>I want to use the code from this file: <code>~/src/Foo.swift</code></p></li>
  <li><p>Syntax like this doesn't work: <code>import ~/src/Foo.swift</code></p></li>
  </ul>
  
  <p>For comparison:</p>
  
  <ul>
  <li><p>An equivalent solution in the Swift REPL for a framework is: <code>import Foundation</code></p></li>
  <li><p>An equivalent solution in the Ruby REPL for a *.ruby file is: <code>require "~/src/foo"</code></p></li>
  </ul>
  
  <p>These are similar questions that are /not/ what I'm asking:</p>
  
  <ul>
  <li><p>How to use/make a Swift command-line script, executable, module, etc.</p></li>
  <li><p>How to use/make an XCode playground, project, library, framework, etc.</p></li>
  <li><p>How to launch the REPL with a pre-existing list of files.</p></li>
  </ul>