Declare some exported names.
>
|
|
| (1) |
Now access them with the operator.
>
|
|
The visibility of exports is, in some sense, "transitive".
>
|
m := module()
export s, p;
s := module()
export e;
e := 2
end module;
p := proc()
s:-e
end proc
end module:
|
If either s is not exported from m, or e is not exported from s, then this does not work.
>
|
m := module()
export p;
local s;
s := module()
export e;
e := 2
end module;
p := proc()
s:-e
end proc
end module:
|
Here, e is not even available inside the body of m.
>
|
m := module()
export p;
local s;
s := module()
local e;
e := 2
end module;
p := proc()
s:-e # error, not an export of s
end proc
end module:
|