Files
swift-mirror/stdlib/core/Process.swift
Doug Gregor f0159f40a1 Ban the "new" syntax for creating an array <rdar://problem/16951969>.
We haven't been advertising this syntax much, and it's closure form
was completely broken anyway, so don't jump through hoops to provide
great Fix-Its here. 


Swift SVN r19277
2014-06-26 23:51:47 +00:00

31 lines
991 B
Swift

//===----------------------------------------------------------------------===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2015 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See http://swift.org/LICENSE.txt for license information
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
@public struct _Process {
// Use lazy initialization of static properties to safely initialize the
// public 'arguments' property on first use.
static var _arguments: [String] = {
return [String](map(0..<Int(C_ARGC)) { i in
if let s = String.fromCStringRepairingIllFormedUTF8(C_ARGV[i]).0 {
return s
}
return ""
})
}()
@public var arguments : [String] {
return _Process._arguments
}
}
@public var Process = _Process()