ok or true? (fwd)

Robert Virding robert.virding@REDACTED
Mon Feb 23 23:10:08 CET 2004


----- Original Message ----- 
From: "Joe Armstrong" <joe@REDACTED>
To: <erlang-questions@REDACTED>
Sent: Monday, February 23, 2004 11:54 AM
Subject: Re: ok or true? (fwd)

> Things that return two possible atoms should *always* return true | false.
>
> Why? - because there are loads of library routines which work on
> predicates.
>
> Suppose you have a function switch_status(...) what returns on | off.
>
> I'd *immediately* rename this as
>
> is_swich_on(...) or switchP(...) that returns true | false

Ah, but now you have changed the funtions to be boolean functions so then
they should naturally return booleans. For the oroiginal functions on|off is
better.

Robert




More information about the erlang-questions mailing list