Args
public struct Args : RandomAccessCollection
Arguments passed to a subroutine.
-
Fetches the argument at the specified position.
Throws
If the argument not exists, is undefined or not convertible to the desired type.
Complexity
O(1).
Declaration
Swift
public func get<T : PerlScalarConvertible>(_ index: Int) throws -> T
Parameters
index
The position of the argument to fetch.
-
Fetches the argument at the specified position.
Throws
If the argument is not convertible to the desired type.
Complexity
O(1).
Declaration
Swift
public func get<T : PerlScalarConvertible>(_ index: Int) throws -> T?
Parameters
index
The position of the argument to fetch.
Return Value
nil
if the argument not exists or is undefined. -
The position of the first argument.
If the arguments are empty,
startIndex
is equal toendIndex
.Declaration
Swift
public var startIndex: Int
-
The arguments’
past the end
position—that is, the position one greater than the last valid subscript argument.If the arguments are empty,
endIndex
is equal tostartIndex
.Declaration
Swift
public var endIndex: Int
-
Accesses the argument at the specified position.
Complexity
O(1).
Declaration
Swift
public subscript(index: Int) -> PerlScalar
Parameters
index
The position of the argument to access.