home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power-Programmierung
/
CD1.mdf
/
magazine
/
aijournl
/
1986_10
/
aiapp5.fig
< prev
next >
Wrap
Text File
|
1986-07-16
|
2KB
|
54 lines
STEP 1
|----------|ì
alloc_str ----> ⁿ constant ⁿì
|----------|ì
| c |ì
|----------|ì
ì
alloc_str(constant,'c')
STEP 2
ì
|----------|ì
ⁿ cons ⁿ tail_ptrì
|----------| ì
cons ---------> | ---------> NILì
|----------|ì
| |ì
|----------|ì
| head_ptr
Vì
|----------|ì
ⁿ constant ⁿì
|----------|ì
| c |ì
|----------|ì
ì
cons(alloc_str(constant,'c'),NIL)
STEP 3 ì
ì
ì
|----------| |----------| |----------|ì
ⁿ cons ⁿ ⁿ cons ⁿ ⁿ cons ⁿì
|----------| |----------| |----------|ì
list ---------> | --------->| --------->| ------> NILì
|----------| |----------| |----------|ì
| | | | | |ì
|----|-----| |----|-----| |----|-----|ì
| | |
V V V ì
|----------| |----------| |----------|ì
ⁿ constant ⁿ ⁿ constant ⁿ ⁿ constant ⁿì
|----------| |----------| |----------|ì
| a | | b | | c |ì
|----------| |----------| |----------|ì
ì
list := cons(alloc_str(constant,'a'),cons(alloc_str(constant,'b'),
cons(alloc_str(constant,'c'),NIL)))
Figure 5 - Constructing the list ('a','b','c') .