Search code examples
programming-languagesfunctional-programmingerlanglogic-programming

What is the use of non short-circuiting boolean operators in Erlang?


I am learning Erlang from the LearnYouSomeErlang web-book. One thing that struck me while learning was the non short-circuiting boolean conjunction and disjunction operators viz; and and or. What are the use cases for these operators? Why would you want to use them instead of andalso and orelse?


Solution

  • It used to be (until R13A) that andalso and orelse weren't tail recursive. See http://www.erlang.org/eeps/eep-0017.html for details. I don't think there is a good reason to use and/or in new programs.