Question: Why should one use alias vs. := ?

August 19 2014 nm 730
0

One can write 

restart;
alias(C=binomial);
C(4,2);

or

restart;
C:=binomial;
C(4,2);

and then both work the same. In the first case, the replacement of "C" by "binomial" is done at parsing time before evluator gets hold of the code, while in the second case, the replacement is done at run-time (evaluation).

So alias will be more efficient and more safe, I assume.

Is that all there is to it, or are there other more subtle and important reasons to use alias vs. :=  when one want to bind long name to smaller ones to save on typing.

 

Please Wait...