Update for Xcode 7.0
authorKeith Rollin <keith.rollin@gmail.com>
Tue, 22 Sep 2015 01:26:47 +0000 (18:26 -0700)
committerKeith Rollin <keith.rollin@gmail.com>
Tue, 22 Sep 2015 01:26:47 +0000 (18:26 -0700)
commit425305df783b668c8eaae5595677dac20165d7f2
tree9f94e9c445f56333af40e33257aaf05de925e717
parent127fcbe0808ef7709b78cf82e646337086e423c7
Update for Xcode 7.0

Optimizations:

* In Environment, skip checking unused local slots if we’ve switched
  over to the general map.
* Mark as much as possible with “final” and “private”, and build with
  -whole-module-optimization, per
  https://developer.apple.com/swift/blog/?id=27.
* Refactor to include alternate types.swift with an implementation based
  on “enum”. Add Makefile variable allowing us to switch between the two
  so that we can compare the results. (At the time of this writing,
  using the class-based implementation is better in terms of both size
  and speed.)

Swift 1.2:

* Use the form of “if-let-as” that allows us to unwrap multiple
  optionals at once.
* Use Swift’s as? rather than our own predicates after determining that
  the former did not incur a performance hit.

Swift 2.0:

* Remove some Array conversions where Foundation/Cocoa is now declared
  to return arrays of the desired type.
* println -> print.
* print() -> print("")
* Remove some NSError* parameters; changed to do/try/catch.
* Use Swift exception handling rather than tunneling that information in
  MalError.
* Use `guard` statements where it makes sense. Especially `guard let a =
  b as? c` statements in order to reduce subsequent forced unwrapping.
* Changed count(str) -> str.characters.count.
* Changed Swift.reduce(coll, ...) -> coll.reduce(...).
* Changed reverse(coll) -> coll.reverse().
* Changed use of .allZeros -> default OptionSet c'tor.
* Changed Printable -> CustomStringConvertible.
* Changed Sequence.extend -> Sequence.appendContentsOf
* Changed String.join -> Sequence.joinWithSeparator
* Changed advance(index, delta) -> index.advancedBy(delta)
* Addressed change in function parameter name requirements.
* Added and used substring(s, begin, end).
* Changed “for ch in str” to “for ch in str.characters”
* Changed some switch/case statements to briefer if/case statements.
* Slices are no longer necessarily 0-based.
* Sprinkle in some @noescapes.
* Search for the most recent swiftc compiler to use if Xcode and
  Xcode-beta are both installed.

Other:
* Delete debugger symbols in `make clean`.
* Rebuild if Makefile is changed.
21 files changed:
swift/Makefile
swift/core.swift
swift/env.swift
swift/printer.swift
swift/reader.swift
swift/readline.swift
swift/step0_repl.swift
swift/step1_read_print.swift
swift/step2_eval.swift
swift/step3_env.swift
swift/step4_if_fn_do.swift
swift/step5_tco.swift
swift/step6_file.swift
swift/step7_quote.swift
swift/step8_macros.swift
swift/step9_try.swift
swift/stepA_mal.swift
swift/templates/step.swift
swift/types.swift [deleted file]
swift/types_class.swift [new file with mode: 0644]
swift/types_enum.swift [new file with mode: 0644]