BEGIN: Difference between revisions

From iMath
Jump to navigation Jump to search
No edit summary
mNo edit summary
Line 18: Line 18:
   ::a=8
   ::a=8
   ns_1::a=3
   ns_1::a=3
If you do not want to see the double colons in the output of [[PRINTVAL]], you need to specify <code>autoformat=true</code>.
|4=
|4=
[[END]]
[[END]]

Revision as of 20:28, 17 February 2020

Syntax

BEGIN symbol

Implemented in iMath since version 2.2.10.

Explanation

Begin a new namespace. Labels and variable names will automatically be prefixed with the namespace.

Example

Note that a leading double colon (::) references the global (top-level) namespace.

 %%ii @a@ EQDEF a=8
 %%ii BEGIN ns_1
 %%ii @ns_1::a@ EQDEF a=3
 %%ii PRINTVAL {a}
 %%ii PRINTVAL {::a}
 %%ii END ns_1
 %%ii PRINTVAL(ns_1::a}

This will print

 a=3
 ::a=8
 ns_1::a=3

If you do not want to see the double colons in the output of PRINTVAL, you need to specify autoformat=true.

See also

END