On this page:
Design Recipes in Post  Fix
8.2

Design Recipes in PostFix

Michael Rohs

The following design recipes and some of the given code examples are inspired by Matthias Felleisen et al.: How to Design Programs, Second Edition, Joe Politz: Design Recipes for Pyret Functions, and Gregor Kiczales: Introduction to Systematic Program Design.

    1 Introduction

      1.1 From Problem Statement to Solution

      1.2 PostFix Language and Development Environment

      1.3 Structure

    2 Recipe for Atomic Data

      2.1 Steps

        2.1.1 Problem statement

        2.1.2 Data definition

        2.1.3 Function name

        2.1.4 Parameter list

        2.1.5 Function stub

        2.1.6 Purpose statement

        2.1.7 Examples and expected results

        2.1.8 Function body

        2.1.9 Testing

        2.1.10 Review and revise

      2.2 Generalizing the Function

      2.3 Exercises

    3 Evaluating Functions Without Side-Effects

    4 Recipe for Enumerations

      4.1 Steps

        4.1.1 Problem statement

        4.1.2 Data definition

        4.1.3 Function name

        4.1.4 Parameter list

        4.1.5 Function stub

        4.1.6 Purpose statement

        4.1.7 Examples and expected results

        4.1.8 Function body

        4.1.9 Testing

        4.1.10 Review and revise

      4.2 Exercises

    5 Recipe for Intervals

      5.1 Steps

        5.1.1 Problem statement

        5.1.2 Data definition

        5.1.3 Function name

        5.1.4 Parameter list

        5.1.5 Function stub

        5.1.6 Purpose statement

        5.1.7 Examples and expected results

        5.1.8 Function body

        5.1.9 Testing

        5.1.10 Review and revise

      5.2 Exercises

    6 Recipe for Itemizations

      6.1 Steps

        6.1.1 Problem statement

        6.1.2 Data definition

        6.1.3 Function name

        6.1.4 Parameter list

        6.1.5 Function stub

        6.1.6 Purpose statement

        6.1.7 Examples and expected results

        6.1.8 Function body

        6.1.9 Testing

        6.1.10 Review and revise

      6.2 Exercises

    7 Recipe for Compound Data (Product Types)

      7.1 Steps

        7.1.1 Problem statement

        7.1.2 Data definition

        7.1.3 Function name

        7.1.4 Parameter list

        7.1.5 Function stub

        7.1.6 Purpose statement

        7.1.7 Examples and expected results

        7.1.8 Function body

        7.1.9 Testing

        7.1.10 Review and revise

      7.2 Data Definitions for Compound Data

      7.3 Exercises

    8 Recipe for Variant Data (Sum Types)

      8.1 Steps

        8.1.1 Problem statement

        8.1.2 Data definition

        8.1.3 Function name

        8.1.4 Parameter list

        8.1.5 Function stub

        8.1.6 Purpose statement

        8.1.7 Examples and expected results

        8.1.8 Function body

        8.1.9 Testing

        8.1.10 Review and revise

      8.2 Data Definitions for Variant Data

      8.3 Exercises

    9 Recipe for Self-Referential Data (Recursive Types)

      9.1 Steps

        9.1.1 Problem statement

        9.1.2 Data definition

        9.1.3 Example Values for Data Definition

        9.1.4 Function name

        9.1.5 Parameter list

        9.1.6 Function stub

        9.1.7 Purpose statement

        9.1.8 Examples and expected results

        9.1.9 Template

        9.1.10 Function body

        9.1.11 Testing

        9.1.12 Review and revise

      9.2 Exercises

    10 Style

      10.1 Naming Conventions

      10.2 Coding Style