0

I am writing a documentation for a programm where a function is defined and it is called three times. I call the definition of the function "function definition". But what is the correct term for the three executions of a function?

I have read the term incarnation. However this name only appears, when the function is called recursivley.

7
  • 1
    en.wiktionary.org/wiki/invocation though, this term is not used anymore, because it causes confusion (due to a negative interpretation) with non-technical people.
    – rwong
    Commented Nov 13, 2020 at 11:51
  • Could you provide a reference to where you have seen "incarnation" used? That's generally a specific religious term. Commented Nov 13, 2020 at 12:01
  • Incarnation is for example used here Commented Nov 13, 2020 at 12:11
  • 3
    @rwong: You surely meant, you try to avoid to use this term, maybe because you have made the experience it might cause confusion with some non-technical people you had to deal with. Nevertheless I think this term is still used often (for example, in the article linked to in the OP's last comment).
    – Doc Brown
    Commented Nov 13, 2020 at 12:37
  • 2
    @rwong: I use "invoke" and "invocation" all the time when describing the times a function gets called. My team is a very multi cultural team with representatives from 6 different continents, and I haven't heard them get confused. "Invocation" is a technical term, and I frankly wouldn't worry about non-technical people being confused. It's like expecting quantum physicists to write technical papers in layman's terms. Sure you might want to use layman's terms in say, USA Today. But if you are publishing something in an academic journal, your audience is different. You need to know your audience. Commented Nov 13, 2020 at 13:43

2 Answers 2

2

Depending on what you mean exactly, you could be talking about:

  • Function call: this is about the process and not any object in memory.
  • Stack frame: the technical nitty-gritty details about how information about which function is called with which arguments is stored on the call stack.
  • Function invocation: a synonym for function call, but I recall seeing it used in a way where it refers to a conceptual (or actual) object that represents said function call.
1

You have one of the potential solutions in your question ;-).

The terms of call and invocation are synonymous and mean the point where you use the name of the function to get it executed. Here a quote in The theory and practice of compiler writing by Tremblay&Sorenson, where they speak about programming language syntax for procedures that return or not values:

For this reason, some language designers have inteoduced a special keyword (e.g. call) to clearly delinate the two types of procedure invocations.

At run time when the function is called, it is executed. Two calls in the source code mean two distinct executions. One call in a loop means n executions. Another term that is also used is activation. Here another quote in the same book, when they speak about run-time control flow, and stack management in the case of a recursive function:

(...) the return from that particular activation of FACTORIAL is the point of invocation within FACTORIAL (...)

(note the wording “point of invocation” to mean the place where the function is called).

Conclusion: In your documentation you should use “execution” exactly as you did in your question. “Activation” could be another alternative, but it is less common than “execution” (except for UML designers that use the term in several diagram to mean the start of execution in some context) and could therefore create some ambiguity. If you do not feel comfortable with “execution” you may consider “execution occurence”. It’s not a formal term bu the “occurence” helps to delineate from the general execution of the software.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.