FREE Subscription to Dr. Dobb’s Digest: Same Great Content, New Digital Edition
Site Archive (Complete)
Web Development
Email
Print
Reprint

add to:
Del.icio.us
Digg
Google
Furl
Slashdot
Y! MyWeb
Blink
January 01, 2001

Programming in Ruby

(Page 8 of 11)
Jan01: Programming in Ruby


class LinkedList
  # ...
  def each
    node = head
    while node
      yield node
      node = node.next
    end
  end
end

Example 7: Iterator for a linked list.

Previous Page | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 Next Page
TOP 5 ARTICLES
No Top Articles.



MICROSITES
FEATURED TOPIC

ADDITIONAL TOPICS

INFO-LINK