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

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

Please add some tests :).

@summivox summivox mentioned this pull request Jan 31, 2016
@summivox
Copy link
Contributor Author

@vendethiel done

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

Thanks!

@summivox summivox deleted the yield-callable branch February 1, 2016 01:41
This was referenced Jan 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants