Home    Reference > C Tags > @x:use
prev next

Description

This command is used to reference names from an external script.

Command Syntax

'@x:use' {<id> {<use specs>}?}
<use specs> ::= {<use spec> ','}* <use spec>
<use spec> ::= 'visible'
<use spec> ::= 'hidden'
<use spec> ::= 'visible' '(' {<use item> ','}* <use item> ')'
<use spec> ::= 'hidden' '(' {<use item> ','}* <use item> ')'
<use item> ::= <id> {'[' ']'}?
<use item> ::= <id> {'[' ']'}? '>' <id>

No options or body are permitted.

Name Semantics

Select visible names declared within the top-level scope of the used script that are visible are also declared within the scope that immediately contains the @x:use command.

There are several cases for each name that is visible within the used script.

The name list forms also provide renaming. The name with the <id> specified before the > declared within the used script is declared with the <id> specified after the > in the enclosing scope.

Execution Semantics

The first attribute <id> will be a script path that identifies an external script. A script path consist consist of a sequence of ids separated with :'s. Initial ids specify a path through nested script directories and the final id will be the id for the script.

No script can directly or indirectly use itself.

Before a script is executed, all other scripts that is uses will have been executed, their results discarded, and their script instances retained.

If another script uses another script either directly or indirectly, then only one instance of that second script will be created.

Examples


   @x:use library:unparser;
   @x:use library:iterator,hidden(Nest > MyNest)