repl(scriptURL:runAsMain:package:)

A REPL, optionally executing a script in its namespace first.

Declaration

case repl(
    scriptURL: URL? = nil,
    runAsMain: Bool = true,
    package: String? = nil
)

Parameters

  • scriptURL: An optional script to run in the REPL namespace.

  • runAsMain: Indicates whether it should run as __main__ or as its file name.

  • package: The parent’s package name. Used for relative imports so they work, whether running as __main__ or not.