REDUCE

7.12 MKID Operator

In many applications, it is useful to create a set of identifiers for naming objects in a consistent manner. In most cases, it is sufficient to create such names from two components. The operator mkid is provided for this purpose. Its syntax is:

mkid(u:id,v:id|non-negative integer):id

for example

        mkid(a,3)      -> a3
        mkid(apple,s)  -> apples

while mkid(a+b,2) gives an error.

The set statement can be used to give a value to the identifiers created by mkid, for example

        set(mkid(a,3),3);

will give a3 the value 2. Similarly, the unset statement can be used to remove the value from these identifiers, for example

        unset(mkid(a,3));


Hosted by Download REDUCE Powered by MathJax