the order of function expression...
Author Message
the order of function expression...

Hi...

"the order of the evolution of function expressions and function
arguments is unspecified.."

What's the function expression exactly?
Does it simply mean function calls?

I can understand that content about arguments,
but I don't know what the function expression is.

Thanks...

Sent via Deja.com http://www.*-*-*.com/

Tue, 11 Mar 2003 03:00:00 GMT
the order of function expression...

: Hi...

: "the order of the evolution of function expressions and function
:  arguments is unspecified.."

Evaluation, not evolution. Evaluation is finding out the value of
something. Evolution is progressing from one form to another.

: What's the function expression exactly?
: Does it simply mean function calls?

I think it means calls as expression operands, such as:
printf("%d\n", foo(i, j)+bar(k, l));
You have no guarantees of in which order i, j, k and l, or foo and bar,
get evaluated or called.

: I can understand that content about arguments,
: but I don't know what the function expression is.

--

| Kingpriest of "The Flying Lemon Tree" G++ FR FW+ M- #80 D+ ADA N+++ |
| http://www.helsinki.fi/~palaste       W++ B OP+                     |
\----------------------------------------- Finland rules! ------------/

"Hasta la Vista, Abie!"
- Bart Simpson

Tue, 11 Mar 2003 03:00:00 GMT
the order of function expression...

Quote:
> Hi...

> "the order of the evolution of function expressions and function
>  arguments is unspecified.."

> What's the function expression exactly?
> Does it simply mean function calls?

> I can understand that content about arguments,
> but I don't know what the function expression is.

In a function call `F(A)`, the function `F` can be a general expression.
For example

typedef int (*MINT)( int );

MINT mintArray[] = { .... };
struct { ... MINT minty; ... } withMint = ...;
extern MINT getMint( ... );

allows us to call functions like:

The sentence you quote tells us that, if the `F` in `F(A)` is a
general expression, the implementation may evaluate it before or
after the arguments `A`, whichever it pleases.

--
Chris "with both being natural choices, worse luck" Dollin
C FAQs at: http://www.faqs.org/faqs/by-newsgroup/comp/comp.lang.c.html

Tue, 11 Mar 2003 03:00:00 GMT
the order of function expression...

Quote:

>Hi...

>"the order of the evolution of function expressions and function

That should be "evaluation".

Quote:
> arguments is unspecified.."

>What's the function expression exactly?

The function expression is the thing that identifies what function is to
be called. It is usually the function name e.g.

foo(arg1, arg2);

foo is the function expression (or function designator) and arg1 and arg2
are the arguments. The function expression can be more complex and
even have side-effects (which can make the order of evaluation important)
when you use function pointers e.g. imagine that you have an array/table
of function pointers functable then you could write

while (functable[i] != NULL)
(*functable[i++])(arg1, arg2);

but not

while (functable[i] != NULL)
(*functable[i++])(i, arg2);

because the order of evaluation of the 2 references to i is unspecified.

--
-----------------------------------------

-----------------------------------------

Tue, 11 Mar 2003 03:00:00 GMT

 Page 1 of 1 [ 4 post ]

Relevant Pages