14

In programming context, you can call a function. This usage is listed on the dictionary ("cause the execution of (a subroutine)" by Oxford), and although I wasn't able to confirm with the dictionaries I have, I'm assuming call as a noun can be used in the same manner.

So when I want to rewrite

By calling this function multiple times, ...

using call as a noun, which preposition do I use?

By multiple calls for this function,

or

By multiple calls of this function,

seems to fit in (to me), and both are found on the internet, as How to limit calls for a function, but to surely process it afterwards and Counting recursive calls of a function.

Which should I choose?

  • 26
    I would use "calls to this function", but wouldn't find anything odd with "calls of this function". But "calls for this function" doesn't work for me. – Colin Fine Apr 11 '17 at 16:03
  • 3
    Invoke/Invocation (of) is also very idiomatic, at least in my opinion. – Shaggi Apr 11 '17 at 19:34
  • 2
    Both "to" and "of" are quite common. – Lee Daniel Crocker Apr 11 '17 at 21:25
15

The most natural way of expressing this would be:

Your app is making multiple calls to this function.

"Function Foo is making 100 call to Bar when run from Snafu."

Your app is making multiple calls of this function.

Adds an abstract nature to the sentence. Sorry, it's difficult to quantify.

I'm getting multiple call for this function.

Implies that people are requesting that a proposed function be written.

  • 5
    Disagree with the middle one--it's still calls to the function. – chrylis Apr 11 '17 at 18:04
  • 5
    "Your app has 100 calls of ToString on an immutable object rather than storing and using the result of one call" - makes sense to me (here, of sounds more right than to), but it may be most suited to methods of objects rather than functions acting on objects... Of course, it could all be in my head. – JPhil Apr 11 '17 at 21:42
  • @JPhil I was thinking almost the exact same thing. "You making lots of ToString calls." Or "You app is making calls of ToString variants that maybe it shouldn't." They sound right but I can't explain why... – Johns-305 Apr 11 '17 at 23:07
1

As Dan said, the correct usage is to and of.

However, say you were making a request to a server. In this situation I'd say you could use for.

As in:

Making multiple calls to the server for this function.

14

I would expect to see calls of this function or calls to this function.

Using calls for this function sounds odd, and partly that may be to do with the fact that "to call for (something)" is a phrase with a very different meaning.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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