...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
Most "quick starts" only get you a few blocks from where you are. From there, you are on your own. Yet, typically, you'd want to get to the next city. This starter kit shall be as minimal as possible, yet packed as much power as possible.
So you are busy and always on the go. You do not wish to spend a lot of time studying the library. You wish to be spared the details for later when you need it. For now, all you need to do is to get up to speed as quickly as possible and start using the library. If this is the case, this is the right place to start.
This section is by no means a thorough discourse of the library. For more information on Phoenix, please take some time to read the rest of the Documentation. Yet, if you just want to use the library quickly, now, this chapter will probably suffice. Rather than taking you to the details of the library, we shall try to provide you with annotated examples instead. Hopefully, this will get you into high gear quickly.
Phoenix is built on function objects (functors). The functor is the main building block. We compose functors to build more complex functors... to build more complex functors... and so on. Almost everything is a functor.
Note | |
---|---|
Functors are so ubiquitous in Phoenix that, in the manual, the words "functor" and "function" are used interchangeably. |
We start with some core functions that are called primitives. You can think of primitives (such as values, references and arguments) as atoms.
Things start to get interesting when we start composing primitives to form expressions. The expressions can, in turn, be composed to form even more complex expressions.