문제

Similar question to this. Keyword yield is present in three languages I know or I heard of: Python, Ruby, C#. They plan to introduce this keyword also to PHP. Where did it originally come from? I did no deep research, but it seems Python has it since 2003, which seems to be before C#.

Update: Let's divide this question into two parts:

  1. Who invited/introduced the concept of generators? Which language provided the first implementation? When?
  2. In which language did the yield keyword appeared first? What year?
도움이 되었습니까?

해결책

  1. Since generators are a special case of coroutines you would have to credit them to the coroutines creator, Melvin Conway, who proposed them in a paper in 1963. source

  2. You can get the answer to that question on Wikipedia. Over there you will see that LISP have some support through libraries in 1958 but is CLU in 1975 which implemented them natively for first time.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top