Economical/cheap bicycle light? Re: Bicycle Lighting 
Author Message
 Economical/cheap bicycle light? Re: Bicycle Lighting

On Mon, 08 Apr 2002 08:45:07 +1000, Darryl Chrisp posted:

Quote:


>> With
>> functional languages you need only test that your function returns the
>> correct value.  If it does, your function is correct and should always be
>> correct.

> Well, that's a very broad statement, and one that you cannot defend in
> general. Consider the purely functional code below:

> double bar()
> {
>     return log(foo());
> }

> Here, your implementation depends on foo() not returning anything less
> than or equal to zero. Checking the return value is not going to make
> this any better because if foo() returns something less than zero it
> doesn't even make sense to produce any value. The point here is that
> this code, which is completely independent of foo(), places an
> implicit constraint on foo(), or is dependent on an implicit
> constraint of foo(). This is similar to code depending on the state of
> an object in an OO language.

If foo() has no arguments in a referentially transparent language, then
it always returns the same value, so bar() need only be tested once.
If foo() returns a value less than zero we bomb out with an exception.
Zachary was quite right.

mrak



Fri, 24 Sep 2004 06:55:42 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Economical/cheap bicycle light? Re: Bicycle Lighting

2. lighting Ive done / do you know other (complex) lighting examples

3. Turn the lights of/Light behaviour

4. BEHEMOTH - computer equipped bicycle using FORTH

5. [ANNOUNCE} bicycle gear shift order calculations

6. Refactoring Browser (Bicycle Repairman)

7. both tasting now, Said and Candy rejected the empty lights in front of cheap counter

8. both tasting now, Said and Candy rejected the empty lights in front of cheap counter

9. both tasting now, Said and Candy rejected the empty lights in front of cheap counter

10. Bright up your advertising with a slim light box !----11 mm LED light box in China!

11. Mainframers: Take back the light (spotlight, that is)

12. A little light exercise ...

 

 
Powered by phpBB® Forum Software