Skip to content

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