CSC/ECE 517 Summer 2008/wiki1 2 i2: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
'' The Question'' | == '' The Question'' == | ||
Ruby, like Java, has iterators to facilitate doing operations on each member of a set. Python has generators as well. Describe how generators differ from iterators, and find examples of code sequences using generators that would be awkward with iterators. [edit] | Ruby, like Java, has iterators to facilitate doing operations on each member of a set. Python has generators as well. Describe how generators differ from iterators, and find examples of code sequences using generators that would be awkward with iterators. [edit] | ||
Understanding of the question | Understanding of the question |
Latest revision as of 01:09, 29 May 2008
The Question
Ruby, like Java, has iterators to facilitate doing operations on each member of a set. Python has generators as well. Describe how generators differ from iterators, and find examples of code sequences using generators that would be awkward with iterators. [edit] Understanding of the question What is an iterator?
[edit]
What is Iterator?
[edit]
Iterators ruby,java,python
[edit]
Example Some code examples References 1. The Pragmatic Programmers - Programming Ruby 2. http://www.google.com/search?q=ruby+iterators&rls=com.microsoft:en-us&ie=UTF-8&oe=UTF-8&startIndex=&startPage=1 3. http://www.devarticles.com/c/a/Ruby-on-Rails/Iterators-in-Ruby/ 4. http://www.math.hokudai.ac.jp/~gotoken/ruby/ruby-uguide/uguide09.html