Received: by 10.114.185.8 with SMTP id i8mr183493waf.26.1227045440724; Tue, 18 Nov 2008 13:57:20 -0800 (PST) Return-Path: Received: from morgoth.cslab.ericsson.net (morgoth.cslab.ericsson.net [193.180.168.22]) by mx.google.com with ESMTP id k32si3232280wah.1.2008.11.18.13.57.19; Tue, 18 Nov 2008 13:57:20 -0800 (PST) Received-SPF: neutral (google.com: 193.180.168.22 is neither permitted nor denied by best guess record for domain of erlang-questions-boun...@erlang.org) client-ip=193.180.168.22; Authentication-Results: mx.google.com; spf=neutral (google.com: 193.180.168.22 is neither permitted nor denied by best guess record for domain of erlang-questions-boun...@erlang.org) smtp.mail=erlang-questions-boun...@erlang.org Received: from morgoth.cslab.ericsson.net (_mail...@localhost.cslab.ericsson.net [IPv6:::1]) by morgoth.cslab.ericsson.net (8.14.0/8.14.0) with ESMTP id mAILqZZp009906; Tue, 18 Nov 2008 22:52:41 +0100 (CET) Received: from mailhub2.otago.ac.nz (mailhub2.otago.ac.nz [139.80.64.247]) by morgoth.cslab.ericsson.net (8.14.0/8.14.0) with ESMTP id mAILqUvv003850 for ; Tue, 18 Nov 2008 22:52:31 +0100 (CET) Received: from chasm.otago.ac.nz (chasm.otago.ac.nz [139.80.32.68]) by mailhub2.otago.ac.nz (8.13.8/8.13.8) with ESMTP id mAILqOZx015711; Wed, 19 Nov 2008 10:52:24 +1300 Received: from oucs1041.otago.ac.nz (oucs1041.otago.ac.nz [139.80.32.187]) by chasm.otago.ac.nz (Postfix) with ESMTP id BBF9410B3B43; Wed, 19 Nov 2008 10:52:23 +1300 (NZDT) Message-Id: <86BD4040-5B68-44A3-A689-CE62AB0880CC@cs.otago.ac.nz> From: "Richard O'Keefe" To: Serge Aleynikov In-Reply-To: <492238C9.60900@gmail.com> Mime-Version: 1.0 (Apple Message framework v929.2) Date: Wed, 19 Nov 2008 10:52:24 +1300 References: <8092dc770811141638h2a1bee2av19c04e76ce535992@mail.gmail.com> <66d1c98f0811141713n6961e091ndcaae79c5cea54f0@mail.gmail.com> <5A0DCFB7-B080-4371-9766-1BB58F2FFB4D@cs.otago.ac.nz> <492238C9.60900@gmail.com> X-Mailer: Apple Mail (2.929.2) Cc: erlang-questi...@erlang.org Subject: Re: [erlang-questions] conditional expressions X-BeenThere: erlang-questi...@erlang.org X-Mailman-Version: 2.1.9 Precedence: list List-Id: Erlang/OTP discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: erlang-questions-boun...@erlang.org Errors-To: erlang-questions-boun...@erlang.org On 18 Nov 2008, at 4:38 pm, Serge Aleynikov wrote: > Your 'must' statement is not entirely accurate. Was there any doubt about what I meant? Let's try again: both 'andalso' and 'orelse' in Erlang have the following properties: the first operand must either return 'true' or 'false' or raise an exception; the second operand, if executed, must either return 'true' or 'false' or raise an exception; the Dialyzer will complain if either operand looks as if it will return something other than 'false' or 'true'; and above all: you CANNOT use them to get the same effect as Lisp's (OR - -) and (AND - -) or Python's similar operators, which allow a normal result from the second operand to be anything at all. I have in fact complained about this, not because I particularly want non-Boolean results from these operators, but because the code that's inserted to check makes them non-tail-recursive. _______________________________________________ erlang-questions mailing list erlang-questi...@erlang.org http://www.erlang.org/mailman/listinfo/erlang-questions