Re: and then... (a curiosity)
- From: Georg Bauhaus <rm.tsoh.plus-bug.bauhaus@xxxxxxxxxxxxxxxxxx>
- Date: Sun, 31 Aug 2008 10:28:56 +0200
Maciej Sobczak wrote:
On 29 Sie, 23:47, Samuel Tardieu <s...@xxxxxxxxxxx> wrote:
Sometimes, you want to ensure that both sides of the boolean operator
have been evaluated. Here is an example:
-- Send the message to the log and return True if it
-- has been logged at least at one place succesfully.
function Log (Message : String) return Boolean is
begin
return Log_To_Network (Message) or Log_To_Disk (Message);
end Log;
This is actually a bad example. It might use "or else" and still
retain the semantics as described in the comment above.
"At least one" of the logs should, I guess, mean to try both.
I.e., the Log subprogram is not about its return value alone.
"Or" achieves all of that (the semantics).
"Or else" might also establish a strict preference for the
network log. "Or" should not.
.
- References:
- and then... (a curiosity)
- From: mockturtle
- Re: and then... (a curiosity)
- From: Samuel Tardieu
- Re: and then... (a curiosity)
- From: Maciej Sobczak
- and then... (a curiosity)
- Prev by Date: Re: and then... (a curiosity)
- Next by Date: Port IO with Gnat
- Previous by thread: Re: and then... (a curiosity)
- Next by thread: Re: and then... (a curiosity)
- Index(es):