next up previous

10.5.1 Specifying InstanceNames

Instance-names are required to be unique within a particular module, but multiple instances of the same name may be in scope at any one time. The syntax of instance-names has been extended to allow module specifications (note that the left and right brackets in bold are to be typed and do not indicate an optional part of the syntax).

Syntax

<instance-name> ::= [<symbol>] |
                    [::<symbol>] |
                    [<module>::symbol>]

Specifying just a symbol as the instance-name, such as [RollsRoyce], will search for the instance in the current module only. Specifying only the :: before the name, such as [::RollsRoyce], will search for the instance first in the current module and then recursively in the imported modules as defined in the module definition. Specifying both a symbol and a module name, such as [CARS::RollsRoyce], searches for the instance only in the specified module. Regardless of which format is specified, the class of the instance must be in scope of the current module in order for the instance to be found.


next up previous