Skip to content

Instantly share code, notes, and snippets.

@Higgs1
Created April 1, 2015 05:55
Show Gist options
  • Save Higgs1/0a08c98af77a2cfd7b95 to your computer and use it in GitHub Desktop.
Save Higgs1/0a08c98af77a2cfd7b95 to your computer and use it in GitHub Desktop.
CoffeeScript "next" function (Python-like)
next = (x) ->
x.next().value
@Higgs1
Copy link
Author

Higgs1 commented Apr 1, 2015

Pulls the next value from a generator, or null if generator is done.

Use with the iter function for maximum Python-ness.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment