Maple Professionel
Maple Académique
Maple Edition Étudiant
Maple Personal Edition
Maple Player
Maple Player for iPad
MapleSim Professionel
MapleSim Académique
Maple T.A. - Suite d'examens de classement
Maple T.A. MAA Placement Test Suite
Möbius - Didacticiels de mathématiques en ligne
Machine Design / Industrial Automation
Aéronautique
Ingénierie des véhicules
Robotics
Energie
System Simulation and Analysis
Model development for HIL
Modélisation du procédé pour la conception de systèmes de contrôle
Robotics/Motion Control/Mechatronics
Other Application Areas
Enseignement des mathématiques
Enseignement de l’ingénierie
Enseignement secondaire et supérieur (CPGE, BTS)
Tests et évaluations
Etudiants
Modélisation financière
Recherche opérationnelle
Calcul haute performance
Physique
Webinaires en direct
Webinaires enregistrés
Agenda des évènements
Forum MaplePrimes
Blog Maplesoft
Membres Maplesoft
Maple Ambassador Program
MapleCloud
Livres blancs techniques
Bulletin électronique
Livres Maple
Math Matters
Portail des applications
Galerie de modèles MapleSim
Cas d'Etudes Utilisateur
Exploring Engineering Fundamentals
Concepts d’enseignement avec Maple
Centre d’accueil utilisateur Maplesoft
Centre de ressources pour enseignants
Centre d’assistance aux étudiants
procname and thisproc - reference to the currently executing procedure
Description
Within a running procedure, the special name procname is substituted by the name with which the procedure was invoked, and the special name thisproc is substituted by the actual procedure invoked.
If there was a chain of evaluations leading to the procedure then procname is the ''last name evaluated'' in the chain. If there is no name then the name unknown is used.
One common use of procname is for a fail return, where it is desired to return the unevaluated function call as the result. This is accomplished by the construct: 'procname(_passed)'.
Note: This concept of the last name evaluated is also the concept used to determine the result of evaluation in the case of a procedure (or a table). Namely, for these cases, the result of evaluation is the last name evaluated in the chain of evaluations, and if there is no name then the procedure (or table) structure results.
A common use of thisproc is to implement a recursive call to the currently executing procedure without having to hard code the procedure's name into the procedure body. If procname were used for this purpose, the recursive call would fail if the original procedure was called without referring to it by a name.
For information about the procedure option named procname, see option.
Examples
f := proc (a) if a > 0 then a^(1/2) else 'procname( _passed )' end if end proc:
fact := proc (a) if a > 1 then a * thisproc(a-1) else 1 end if end proc:
See Also
_passed, option, procedure, return, table
Download Help Document