17.1 The definitions.dylan file

This file contains common definitions that are used throughout several libraries in the airport example.

The definitions.dylan file.

module: definitions

// This file contains constants and other definitions used in common with
// the other parts of the airport example

// The capital letters of the alphabet
define constant $letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";

// This type represents positive integers
define constant <positive-integer> = limited(<integer>, min: 1);

define constant $hours-per-day = 24; 

define constant $minutes-per-hour = 60;

define constant $seconds-per-minute = 60; 

define constant $seconds-per-hour 
  = $minutes-per-hour * $seconds-per-minute; 

// This method returns the union of the false type and a type you specify,
// as a simple shorthand
// This method may already be provided by your Dylan implementation
define method false-or (other-type :: <type>) => (combined-type :: <type>)
  type-union(singleton(#f), other-type);
end method false-or;