See the pattern write-ups on the Ruby Garden Wiki for a discussion of this
issue.

http://www.rubygarden.org/ruby?ExampleDesignPatternsInRuby

In particular:

http://www.rubygarden.org/ruby?IteratorPattern
http://www.rubygarden.org/ruby?VisitorPattern

Cheers,
            Nat.

________________________________
Dr. Nathaniel Pryce
B13media Ltd.
40-41 Whiskin St, London, EC1R 0BP, UK
http://www.b13media.com

----- Original Message -----
From: "Henning von Rosen" <henning / ikso.net>
To: "ruby-talk ML" <ruby-talk / ruby-lang.org>
Sent: Wednesday, January 09, 2002 12:13 PM
Subject: "Visitor" should be "Iterator" in Programming Ruby?


> """The Visitor Pattern
>
> It's the method each. """
>
> I came to mention the above chapter in Programming Ruby, in a letter to
> Thomas K?hne, the author of "A Functional Pattern System for
Object-Oriented
> Design". BTW, this is a very well written and interesting book, also from
a
> Ruby language design perspective. It also gives a brief presentation of
the
> FP resp OO concepts pros-and-cons in the beginning.
> http://www-agce.informatik.uni-kl.de/~kuehne/fps/
>
> >> Reading about the issue of less-lang-support->more-pattern-relevance, I
> came
> >> to think of a passage from one of the Ruby books. A chapter treats
> >> implementations of some well-known patterns. The whole text of the
> >> subchapter on The Visitior Pattern, is "It's the method each.".
>
> [Thomas K?hne]>I find that hard to believe.
> >With regard to the "Iterator Pattern" the answer would be "its the method
> >each", but there is an element of double dispatch in visitor, which I
don't
> >think is supported by Ruby as a language mechanism and anyway it would
>be
> more than just the method "each".
>
> Cheers,
>
> Henning
>