coffeescript icon indicating copy to clipboard operation
coffeescript copied to clipboard

Will Coffee-script add yield statement?

Open OnesimusUnbound opened this issue 15 years ago • 2 comments

something like this

counter = (start = 0, step = 1) ->
    idx = start
    while true
        yield idx
        idx += step

countFrom10 = counter 10
countFrom10() # returns 10
countFrom10() # returns 11
countFrom10() # returns 12
# and so on and so forth . . .

OnesimusUnbound avatar Mar 14 '11 05:03 OnesimusUnbound

Very unlikely, at least for now. jashkenas wants to keep support in for IE6. One day, he'll give it up. With microsoft now counting down until its doom, it seems like that day is actually on the horizon.

michaelficarra avatar Mar 14 '11 05:03 michaelficarra

No -- yield is not a standard part of JavaScript, and doesn't work in any browser apart from Firefox.

jashkenas avatar Apr 21 '11 01:04 jashkenas