1. expression evaluation

Rob,

can I safely assume strict left-to-right expression evaluation (unless, of
course, mandated otherwise by the precedence of operators)?

jiri

new topic     » topic index » view message » categorize

2. Re: expression evaluation

jiri babor wrote:
> can I safely assume strict left-to-right expression evaluation (unless, of
> course,
> mandated otherwise by the precedence of operators)?

Yes. That's the general rule, though I'd feel safer
if you would give a specific example.

Regards,
   Rob Craig
   Rapid Deployment Software
   http://www.RapidEuphoria.com

new topic     » goto parent     » topic index » view message » categorize

3. Re: expression evaluation

Robert Craig wrote:
> jiri babor wrote:
>> can I safely assume strict left-to-right expression evaluation (unless, of
>> course,
>> mandated otherwise by the precedence of operators)?
>
> Yes. That's the general rule, though I'd feel safer
> if you would give a specific example.


Thanks, Robert. Is the following fragment specific enough?

    object result
    integer level

    function foo(...)
        ...
        level = ...
        return ...
    end function

    ...
    result = foo(...) * level


In the last line: is foo() always evaluated first, so that level is
appropriately set?


Warning to resident PC hounds before they start barking about side effects, etc:
don't strain your vocal cords, I am not listening...

new topic     » goto parent     » topic index » view message » categorize

4. Re: expression evaluation

jiri babor wrote:
> Robert Craig wrote:
> > jiri babor wrote:
> >> can I safely assume strict left-to-right expression evaluation (unless, of
> >> course,
> >> mandated otherwise by the precedence of operators)?
> >
> > Yes. That's the general rule, though I'd feel safer
> > if you would give a specific example.
> 
> 
> Thanks, Robert. Is the following fragment specific enough?
> 
>     object result
>     integer level
> 
>     function foo(...)
>         ...
>         level = ...
>         return ...
>     end function
> 
>     ...
>     result = foo(...) * level
> 
> 
> In the last line: is foo() always evaluated first, so that level is
> appropriately set?

Yes.

Regards,
   Rob Craig
   Rapid Deployment Software
   http://www.RapidEuphoria.com

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu