[erlang-questions] style question - best way to test multiple non-guard conditions sequentially

Siraaj Khandkar siraaj@REDACTED
Fri Jun 21 07:23:29 CEST 2013


On Jun 21, 2013, at 1:04, "Richard A. O'Keefe" <ok@REDACTED> wrote:

> 
> On 21/06/2013, at 3:41 PM, Jonathan Leivent wrote:
>>> Well, for one thing, it might be an idea to rip the branching structure
>>> out of the receive.
>> 
>> Yeah, sure.  But, I'm forced to do that, instead of deciding to do it if and when it's a good way to modularize the code.
> 
> Someone has a blog where they looked at how to write Erlang code
> so that it's _obviously_ right, and ripping things into smaller
> pieces was part of it.  If you can't name it, you don't understand it.


http://www.gar1t.com/blog/2012/06/10/solving-embarrassingly-obvious-problems-in-erlang/


> I do repeat that more than 40 years after meeting formal logic,
> I love logic, but am extremely suspicious of Boolean expressions in
> functional languages.  Most Boolean-valued functions that have been
> discussed in this mailing list turned out to be things that would be
> better conceived some other way (like a Haskell Maybe or Either or
> something with more than two possibilities).

I _really_ liked the following two posts, by Rob Harper, discussing this issue:

http://existentialtype.wordpress.com/2011/03/15/dont-mention-equality/

http://existentialtype.wordpress.com/2011/03/15/boolean-blindness/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20130621/59f733c6/attachment.htm>


More information about the erlang-questions mailing list