Skip to content
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

@summivox
Copy link
Contributor

@summivox 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
Copy link
Contributor

@vendethiel vendethiel commented Jan 31, 2016

Please add some tests :).

@summivox summivox mentioned this pull request Jan 31, 2016
@summivox summivox force-pushed the summivox:yield-callable branch from 7ff8abe to fade767 Jan 31, 2016
@summivox
Copy link
Contributor Author

@summivox summivox commented Jan 31, 2016

vendethiel added a commit that referenced this pull request Feb 1, 2016
fix: `yield` expression should be callable
@vendethiel vendethiel merged commit 856ab6b into gkz:master Feb 1, 2016
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@vendethiel
Copy link
Contributor

@vendethiel 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
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants