What does `foo` in the Parallel Computing docs refer to?

On this page: https://docs.julialang.org/en/latest/manual/parallel-computing.html#Global-variables-1

we have the following code snippet:

A = rand(10,10)
remotecall_fetch(()->foo(A), 2)

This function foo is repeated several times, but there is no explanation of what foo is. Do I use the actual function foo? Do I use any random identifier? Does this function need to exist on the local or the worker process? Can anyone clarify?


Foo and bar are common words used as placeholders in programming. Wikipedia explains it better than I can: “… used to name entities such as variables, functions, and commands whose exact identity is unimportant and serve only to demonstrate a concept.”

So in this case, foo refers to any function.

1 Like

In that case the documentation needs to be updated. Any code example should actually work when you type it out unless the person writing the docs is trying really hard to frustrate readers.


In this case foo is expected to be a function that takes 2D array as a parameter, and is defined in the remote process. So you could, for example, think of the term foo being replaced with the function norm. I agree this is confiusing as written.



Thanks avik, now if we could just get this answer into the docs :slight_smile:

Why don’t you try making a Pull Request. For things like this you can edit the file directly on GitHub using the pencil icon.

Click the pencil and type away :slight_smile:. This is how Julia’s docs get better.

1 Like

Thanks all, this is now a pull request: https://github.com/JuliaLang/julia/pull/22317


Thanks Phillip for the PR!