Re: normal order vs. applicative order question
- From: Anton van Straaten <anton@xxxxxxxxxxxxxxxx>
- Date: Tue, 31 Jan 2006 20:16:29 GMT
H. wrote:
Yes, that makes sense; thanks.
In applicative order, you evaluate operand expression before you apply the operator; in normal order, you evaluate expressions when you need their value, right?
So imagine an operand expression whose evaluation takes a long time but whose value is never needed.
It should be mentioned that applicative order evaluation results in each operand expression only being evaluated once, whereas with unoptimized normal order, the same operand expression may be evaluated any number of times (including zero times, as pointed out above).
This means that in most realistic cases, normal order evaluation cannot be as efficient as applicative order unless the evaluation of operand expressions is optimized so that they're evaluated at most once.
Anton .
- References:
- normal order vs. applicative order question
- From: H.
- Re: normal order vs. applicative order question
- From: Jussi Piitulainen
- Re: normal order vs. applicative order question
- From: H.
- normal order vs. applicative order question
- Prev by Date: Re: normal order vs. applicative order question
- Previous by thread: Re: normal order vs. applicative order question
- Next by thread: Re: normal order vs. applicative order question
- Index(es):
Relevant Pages
|