[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
please clarify the manual on foreach function?
From: |
Mark Galeck (CW) |
Subject: |
please clarify the manual on foreach function? |
Date: |
Fri, 18 Feb 2011 11:50:26 -0800 |
Hello, the manual says:
"The syntax of the foreach function is:
$(foreach var,list,text)
The first two arguments, var and list, are expanded before anything else is
done; note that the last argument, text, is not expanded at the same time. Then
for each word of the expanded value of list, the variable named by the expanded
value of var is set to that word, and text is expanded. Presumably text
contains references to that variable, so its expansion will be different each
time.
The result is that text is expanded as many times as there are
whitespace-separated words in list. The multiple expansions of text are
concatenated, with spaces between them, to make the result of foreach."
Questions: 1. When I read the above carefully, it does not really say that
the expansions of text are concatenated _in the same order_ as in list. Is
this guaranteed or not?
2. Again when I read carefully, it does not say the expansion happen
"serially" that is, in time, one after another. Make could presumably do all
of them in parallel, especially when invoked with -j<multiple> remember the
results and then concatenate (in some order) when it is done. Is this
guaranteed to happen serially??
Mark
- please clarify the manual on foreach function?,
Mark Galeck (CW) <=