From: Philipp Huber Date: 2005-09-01T18:57:32+09:00 Subject: Re: implementing the "each" method for own classes actually i did test it with a queue filled with a few elements. as you said the condition for the while loop should be testet at the beginning, otherwise nil could be returned. so my code looks like this: def each node=@head while node=node.next yield node.content end end do you have an example for the second remark, as i don't quite understand what you mean thanks, philipp