Version 4 (modified by hack.augusto, 7 years ago)

Tipo and url fixed

Visitor Pattern

The visitor design pattern is a way of separating an algorithm from an object structure upon which it operates. This enables the addition of new operations to existing object structures without modifying those structures.

Cobra provides a Visitor base class in its standard library. You can read its doc string and browse its members by looking in Cobra.Core/Visitor.cobra online or in your local installation.

Theres an example of use wrt the cobra compiler in Cobra.Lang/DocGenerator.cobra

External pages on visitors:

See also: LibraryTopics