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/
Before you buy.



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:

    answer = mintArray[someIndex]( 42 );
    answer = withMint.minty( 27 );
    answer = getMint(...)( 69 );

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  
 
 [ 4 post ] 

 Relevant Pages 

1. Order of expression evaluation in C++

2. Expression evaluation order

3. Order of evaluation for unary expressions

4. Order of evalution of expressions.

5. Order of evaluation of expressions.

6. Order of evaluating if(expression)...?

7. String functions or using Regular Expressions or StringBuilder

8. regular expressions expression with space and then multiple spaces

9. Evaluting a string value as field,variable,function or expression

10. Are Postfix expressions Unary expressions?

11. expression syntax in function main error

12. ISO: string.h like functions which use regular expressions

 

 
Powered by phpBB® Forum Software