June 2013
Intermediate to advanced
312 pages
6h 47m
English
#|
So far, we have covered the basics of defining variables and functions. Did you wonder if there was more to it? In this chapter, we will show you everything you need to know about definitions.
|#
The most common kind of definitions are module-level definitions. These introduce names that can be accessed anywhere in the module. For now, think of a module as the definitions panel. There are two kinds of module-level definitions: variable definitions and function definitions.
Let’s begin with variable definitions. Suppose we were to develop a graphical version of the Guess My Number game from Chapter 2 that displays its results on a window of some fixed size. The ...