Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

Share this Page URL
Help

Chapter 12. Script Objects > Exercises - Pg. 416

Chapter 12 Scripts behave like lists and records when they are assigned or passed as arguments to handlers. The set command just makes a new reference to a scrip object; the copy command makes a new copy of the current script object. A handler can define and return a script object. A script object can contain handler definitions. A script can inherit properties and handlers from its parent; it can also override properties and handlers inherited from the parent script. A script can be stored in a file using the store script command. A script stored in a file can be run using the run script command and loaded into your program using the load script command. A handler or property defined in a parent can be explicitly referenced through its parent property. A handler in a parent can be run within the context of the child by using the continue command. Scripts can be used to implement many of the OOP paradigms, such as instantiation, methods, instance variables, data encapsulation, and polymorphism. In the next chapter, I take a look at some miscellaneous material that was either a little advanced or just didn't quite fit in any other chapter of the book. Before proceeding, however, try the exercises that follow to test your understanding of the material covered in this chapter. You can find the solutions to these exercises in Appendix A.