I am writing a BASIC Interpreter for the Command Line in Swift 2, and I cannot find a way to implement the simple command, CLS (clear all text from the Terminal.) Should I s
This answer applies to Swift 2.1 or earlier only
To elaborate on Arc676's answer:
The system command is imported into Swift via the Darwin module on Mac platforms (with other C APIs). On Linux, Glibc replaces Darwin for bridging low-level C APIs to Swift.
import Glibc
// ...
system("clear")
Or, if the system call is ambiguous, explicitly call Glibc's system (or Darwin on Mac platforms):
import Glibc
// ...
Glibc.system("clear")