Learning Erlang: Control Structures

06 Jul 2007 22:08 - (0) comments

So far, we haven’t seen any if statements, or switch statements or for statements, or while statements, and yet this doesn’t seem to matter. Everything is written using pattern-matching and higher order functions. So far we haven’t needed any additional control structures.
If we want additional control structures we have a power ful glue that we can use to make our own control structures....

As you become more experienced, you’ll find that being able to create your own control structures can dramatically decrease the size of your programs and sometimes make them a lot clearer. This is because you can create exactly the right control structures that are needed to solve your problem, and you are not restricted by a small and fixed set of control structures that came with your programming language.

Programming Erlang

Comments

No comments allowed.

Admin