Intro to Fun, Part 2
Towards Functional Programming with Real Studio
Issue: 11.1 (November/December 2012)
Author: Daniel Gross
Article Description: No description available.
Article Length (in bytes): 18,944
Starting Page Number: 24
RBD Number: 11106
Resource File(s): None
Related Link(s): None
Known Limitations: None
Excerpt of article text...
In part one of this two-part article series I illustrated how looping functions, such as the filter  and map  functions, implemented in the fun functional library, support a functional programming style in Real Studio. I also discussed how a functional coding style helps make code easier to understand, maintain and change. In this article I illustrate two additional functional programming features offered by the fun library, functional composition and closure, and explain why they are needed and the benefits that the features offer.
The next section illustrates how to use functional composition to flexibility and add functionality to already existing code. Section three motivates the need for closure, a key concept in function programming, explains the concept and illustrates its use. Finally, I conclude the article with a discussion describing how function composition and closure was implemented in the fun library.
Functional composition in Real Studio
...End of Excerpt. Please purchase the magazine to read the full article.
Article copyrighted by REALbasic Developer magazine. All rights reserved.