Maple für Professional
Maple für Akademiker
Maple für Studenten
Maple Personal Edition
Maple Player
Maple Player für iPad
MapleSim für Professional
MapleSim für Akademiker
Maple T.A. - Testen & beurteilen
Maple T.A. MAA Placement Test Suite
Möbius - Online-Courseware
Machine Design / Industrial Automation
Luft- und Raumfahrt
Fahrzeugtechnik
Robotics
Energiebranche
System Simulation and Analysis
Model development for HIL
Anlagenmodelle für den Regelungsentwurf
Robotics/Motion Control/Mechatronics
Other Application Areas
Mathematikausbildung
Technik
Allgemein- und berufsbildende Schulen
Testen und beurteilen
Studierende
Finanzmodelle
Betriebsforschung
Hochleistungsrechnen
Physik
Live-Webinare
Aufgezeichnete Webinare
Geplante Veranstaltungen
MaplePrimes
Maplesoft-Blog
Maplesoft-Mitgliedschaft
Maple Ambassador Program
MapleCloud
Technische Whitepapers
E-Mail Newsletters
Maple-Bücher
Math Matters
Anwendungs-Center
MapleSim Modell-Galerie
Anwenderberichte
Exploring Engineering Fundamentals
Lehrkonzepte mit Maple
Maplesoft Welcome-Center
Resource-Center für Lehrer
Help-Center für Studierende
Last Name Evaluation
Maple supports the concept of "last name evaluation." This refers to the specific evaluation rules applied to certain kinds of expressions.
Most Maple expressions are evaluated by using full recursive evaluation. This implies that each name in the expression is fully evaluated to the last assigned expression in any chain of assignments. For example, names that are assigned integers are subject to normal, full evaluation.
b := a;
b;
a := 2;
a;
However, a name assigned to a value that is one of the special types, such as procedures, modules and tables (hence, matrices, vectors and arrays, but not rtables), is not fully evaluated during normal evaluation. Assignment chains are only evaluated to the last name assigned in the chain (hence the name of this property).
Note: The commands array, matrix, and vector are deprecated. The rtable-based commands Array, Matrix, and Vector supersede them.
v := u;
v;
u := table( [ 1 = "a", 2 = "b" ] );
u;
To obtain the final expression to which the last name in an assignment chain is assigned, you can use the procedure eval.
u := table( [ "a" = 1, "b" = 2, "c" = 3 ] );
eval( u );
This is frequently required when returning such expressions from procedures. A procedure that returns a table, module, or another procedure normally requires an evaluation at the return site, using the two-argument form of eval in which the second argument is 1.
For example,
f := proc( n ) local p; p := proc( s ) modp( 1 + s, n ) end; p end proc:
f( 5 );
returns the escaped local variable name p, rather than the procedure that it is assigned. (Of course, the local variable p is still assigned the procedure.) By using a call to eval on the return expression
f := proc( n ) local p; p := proc( s ) modp( 1 + s, n ) end; eval( p, 1 ) end proc:
the actual procedure is returned.
See Also
Array, eval, Eval, evala, evalb, evalc, evalf, evalhf, evalm(deprecated), evaln, evalr, map, map2, procedure, spec_eval_rules, timelimit, trace, uneval, value, zip
Download Help Document