New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: `yield` expression should be callable #823

Merged
merged 2 commits into from Feb 1, 2016

Conversation

Projects
None yet
2 participants
@summivox
Contributor

summivox commented Jan 25, 2016

Since yield expressions evaluate to argument passed to next, if a function is passed it should be callable.

Example:

f = ->* (yield)!
g = -> console.log 'hit'
f!
  ..next!
  ..next g

should compile to:

var f, g, x$;
f = function*(){
  return (yield)();
};
g = function(){
  return console.log('hit');
};
x$ = f();
x$.next();
x$.next(g);
@vendethiel

This comment has been minimized.

Contributor

vendethiel commented Jan 31, 2016

Please add some tests :).

@summivox summivox referenced this pull request Jan 31, 2016

Open

yield through pipe #828

@summivox

This comment has been minimized.

Contributor

summivox commented Jan 31, 2016

vendethiel added a commit that referenced this pull request Feb 1, 2016

Merge pull request #823 from summivox/yield-callable
fix: `yield` expression should be callable

@vendethiel vendethiel merged commit 856ab6b into gkz:master Feb 1, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@vendethiel

This comment has been minimized.

Contributor

vendethiel commented Feb 1, 2016

Thanks!

@summivox summivox deleted the summivox:yield-callable branch Feb 1, 2016

This was referenced Jan 11, 2018

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