[erlang-questions] naive execution of guards

Toby Thain <>
Tue Dec 12 19:41:51 CET 2006


On 12-Dec-06, at 1:35 PM, Thomas Lindgren wrote:

>
> --- "Ulf Wiger (TN/EAB)" <>
> wrote:
>
>>
>> I was curious to see whether the compiler would
>> optimize away repeated
>> use of the length/1 guard, e.g in the following
>> code:
> ...
>> I'm sure it's tricky, and I don't know if the above
>> reasons are strong
>> enough.
>
> Actually, this optimization is ordinary elimination of
> common subexpressions, and so should be relatively
> straightforward to implement.

Especially since the subexpressions are already guaranteed side- 
effect free (right?)
:)
--Toby

>
> Best,
> Thomas
>
>
>
>
> ______________________________________________________________________ 
> ______________
> Cheap talk?
> Check out Yahoo! Messenger's low PC-to-Phone call rates.
> http://voice.yahoo.com
> _______________________________________________
> erlang-questions mailing list
> 
> http://www.erlang.org/mailman/listinfo/erlang-questions




More information about the erlang-questions mailing list