By Mauny M.
Read or Download Functional Programming Using Calm Light PDF
Best programming books
This can be a ebook for these people who believed that we didn’t have to examine Perl, and now we all know it truly is extra ubiquitous than ever. Perl is intensely versatile and strong, and it isn’t frightened of net 2. zero or the cloud. initially touted because the duct tape of the net, Perl has because developed right into a multipurpose, multiplatform language current totally all over: heavy-duty net functions, the cloud, platforms management, common language processing, and monetary engineering.
- Programming Your Home: Automate with Arduino, Android, and Your Computer (Pragmatic Programmers)
- Structured Programming With Goto Statements
- Professional Microsoft SQL Server Analysis Services 2008 with MDX (Wrox Programmer to Programmer)
- Nuclear Reprogramming: Methods and Protocols
Additional info for Functional Programming Using Calm Light
You can get into serious trouble, how‐ ever, if your termination test relies on == or === for comparison to a single value rather than >= or <= for comparison to a range. Recursing with Return Values The counting examples are simple—they demonstrate how recursion works, but just discard the return values. puts calls return the atom :ok—but they aren’t of much use. More typically, a recursive function call will make use of the return value. A classic recursive call calculates factorials. A factorial is the product of all positive integers equal to or less than the argument.
Usually, atoms are bits of text that start with a colon, like :ok or :earth or :Today. They can also contain underscores (_) and at symbols (@), like :this_is_a_short_sen tence or :me@home. If you want more freedom to use spaces, you can start with the colon, and then put them in single quotes, like :'Today is a good day'. Generally, the one-word lowercase form is easier to read. Atoms have a value—it’s the same as their text: iex(1)> :test :test That’s not very exciting in itself. What makes atoms exciting is the way that they can combine with other types and Elixir’s pattern-matching techniques to build simple but powerful logical structures.
Example 2-6, in ch02/ex5-import, shows a simple use of import to bring in all the func‐ tions (and macros, though there aren’t any yet) in the Convert module. Example 2-6. fall_velocity(meters)) end end The import Convert line tells Elixir that all of the functions and macros (except those starting with underscore) in the Convert module should be available without prefixes in this module. Importing an Erlang module, shown in Example 2-7, is much the same, except that you prefix the module name with a colon and don’t start the name with an uppercase letter: Example 2-7.