RE: [sv-bc] Constant method calls

From: Bresticker, Shalom <shalom.bresticker_at_.....>
Date: Tue Feb 12 2008 - 12:53:31 PST
I've added the questions and possible resolutions to Mantis 2010.

Shalom 

> Presumably there are two options for enumval.next(N) when 
> enumval has an invalid value:
> 
> 1. Return the default initial value, regardless of what N is.
> 
> 2. Treat enumval.next(N) as being equivalent to 
> enumval.next.next(N-1) for a value of N > 1.  In this case, 
> the first application of next would produce the default 
> initial value.  If that is an invalid enum value, then the 
> result is the same as the first option, since each additional 
> application returns that same invalid value.  However, if it 
> is a valid enum value, then the result would be the same as 
> applying next(N-1) to that value.
> 
> The second option is more mathematically elegant.
> 
> Note that similar reasoning would define enumval.next(0) as 
> being enumval, since that is the result of applying next 0 times.
> 
> Suppose we accept that enumval.next(0) is the same as enumval 
> when enumval is a valid value.  If enumval is not a valid 
> value, then the way to extend each of the options above seems 
> obvious.  In the first option, enumval.next(0) would return 
> the default initial value, since it does that regardless of 
> what N is.  In the second option, it would return enumval, 
> since that is the result of applying next o times.
---------------------------------------------------------------------
Intel Israel (74) Limited

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Tue Feb 12 12:55:53 2008

This archive was generated by hypermail 2.1.8 : Tue Feb 12 2008 - 12:56:13 PST