Next Page Contents

Pref::alias -- controls the output of aliased expressions

Introduction

Pref::alias(TRUE) switches the usage of alias abbrevations in outputs on.

Pref::alias(FALSE) switches the usage of alias abbrevations in outputs off.

Pref::alias() returns the current setting.

Call(s)

Pref::alias()
Pref::alias(TRUE)
Pref::alias(FALSE)
Pref::alias(NIL)

Returns

the last defined value

Side Effects

Pref::alias changes the output of aliased expressions.

Related Functions

alias, expr2text, fprint, print

Details

Example 1

If an aliased expression occurs in output, it is replaced by the alias abbrevation:

>> alias(X = a + b):
   X, a + b
                                   X, X

This only works if the syntactical structure of expression matches the aliased expression:

>> 2*X
                                 2 a + 2 b

prog::exprtree shows that 2*X does not contain a + b any more:

>> prog::exprtree(X): prog::exprtree(2*X):  
                                   _plus
                                   |
                                   +-- a
                                   |
                                   `-- b
      
                                 _plus
                                 |
                                 +-- _mult
                                 |   |
                                 |   +-- a
                                 |   |
                                 |   `-- 2
                                 |
                                 `-- _mult
                                     |
                                     +-- b
                                     |
                                     `-- 2

The same holds for X+c:

>> X + c; prog::exprtree(X + c):
                                 a + b + c
      
                                   _plus
                                   |
                                   +-- a
                                   |
                                   +-- b
                                   |
                                   `-- c

With Pref::alias(FALSE) the back translation of aliases in the output is disabled:

>> Pref::alias(FALSE):
   X
                                   a + b

Pref::alias has no effect on print and fprint outputs:

>> Pref::alias(TRUE):
   print(X):
                                   a + b

Changes




Do you have questions or comments?


Copyright © SciFace Software GmbH & Co. KG 2000