Next:
Basic Abstractions
Up:
Contents
Previous:
Meta Object Protocol Pattern
Contents
Discovering the Power of A++
Subsections
Basic Abstractions
The IF- Abstraction
Remark:
Body of the IF-Abstraction
Application of basic logical abstractions
Extended Logical Abstractions
not
and
or
Application of extended logical abstractions
Numeric Abstractions
Natural Numbers
Explanation of `three apples'
zero
one
two
three
zerop
Arithmetic Operations
compose
Adding two numbers: add
succ
Multiplying two numbers: mult
Application of numeric abstractions
Collections of Data
Basic abstractions for pairs
Constructor `cons'
Selector `car'
Selector `cdr'
Application of abstractions for pairs
Basic utility abstractions for lists
Abstraction for the end of a list: `nil'
Checking for an empty list: `nullp'
Determining the length of a list: `length'
Removing an element from a list: `remove'
Retrieving the n-th element from a list: `nth'
Extended Numerical Abstractions
Abstraction `zeropair'
Decrementing a number: `pred'
Subtracting a number: `sub'
Relational Abstractions
Comparing two numbers: `equaln'
Comparing two numbers: `gtp'
Comparing two numbers: `ltp'
Comparing two numbers: `gep'
Examples for recursion
Calculating the faculty of a number
Calculating the sum of elements of a list
Insertion Sort
sorted insertion into a list
'insertion-sort'
Higher Order Functions
Creating a new function by composition: `compose'
Changing the arity of a function:`curry'
Converting all elements in a list: `map'
Converting the `map' function: `mapc'
Selecting elements from a given list: `filter'
Searching for an element in a given list: `locate'
Iterating through all elements of a list: `for-each'
Set Operations
Checking for a member in a set: `memberp'
Adding an element to a set: `addelt'
Combining two sets: `union'
Associative Lists in A++
Abstractions for associative lists
Application of associative lists
Miscellaneous abstractions
Testing the basic abstractions
Object Oriented Programming in A++
First example of object oriented programming in A++
Source code for constructor `make-account'
Testing class `account'
2nd example of object oriented programming in A++
OOP-Technology in application `animal-ahelter'
Classes of `animal-shelter' application
Class diagram for 2nd example of object oriented programming
Base class for all classes
Class `animal'
Class `dog'
Class `cat'
Class `animal-shelter'
Test of `animal-shelter'
Test output part 1
Test output part 2
3rd example of object oriented programming in A++
Classes of `library' application
Class Diagram of Library Management Application
Class `base-object-class'
Class `person'
Class `author'
Class `reader'
Class `book'
Class `library' part 1
Class `library' part 2
Class `library' part 3
Library test part 1
Library test part 2
Library test part 3
Test output part 1
Test output part 2
Imperative Programming in A++
The abstraction `while'
A++ code of `while'
Georg P. Loczewski 2004-03-05
Impressum und Datenschutz