Skip to content

Instantly share code, notes, and snippets.

@intrepidmatt
Created June 11, 2014 15:03
Show Gist options
  • Select an option

  • Save intrepidmatt/f9295f2c9d4cf0efb031 to your computer and use it in GitHub Desktop.

Select an option

Save intrepidmatt/f9295f2c9d4cf0efb031 to your computer and use it in GitHub Desktop.
struct ArgumentList : Sequence {
var arguments: String[]
// init ...
func generate() -> GeneratorOf<String> {
var i = 0;
return GeneratorOf<String>({
if (i > self.arguments.count) {
return .None
} else {
return self.arguments[i++];
}
})
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment