Commit | Line | Data |
---|---|---|
3d6d4647 C |
1 | type pinteger = ^integer; |
2 | realarray = array[0..10] of real; | |
3 | pintarray = array[0..10] of pinteger; | |
4 | listoffixnumscell = record | |
5 | cdr : ^listoffixnumscell; | |
6 | fixnum : pinteger; | |
7 | end; | |
8 | plistcell = ^listcell; | |
9 | listcell = record | |
10 | cdr : plistcell; | |
11 | car : integer; | |
12 | end; | |
13 | ||
14 | function pfoo ( var a : integer ; | |
15 | var b : realarray; | |
16 | var c : pintarray; | |
17 | var d : listoffixnumscell) : integer; | |
18 | begin | |
19 | writeln(' a:',a, ' b[0]:', b[0], ' b[1]:', b[1]); | |
20 | writeln(' c (first):', c[0]^,' c (second):', c[1]^); | |
21 | writeln(' ( ', d.fixnum^, d.cdr^.fixnum^, ' ...) '); | |
22 | b[1] := 3.1415926; | |
23 | pfoo := 3 | |
24 | end ; | |
25 | ||
26 | { the function pmemq looks for the lisp pointer given as the first argument | |
27 | in the list pointed to by the second argument. | |
28 | Note that we declare " a : integer " instead of " var a : integer " since | |
29 | we are interested in the pointer value instead of what it points to (which | |
30 | could be any lisp object) | |
31 | } | |
32 | function pmemq( a : integer; list : plistcell) : plistcell; | |
33 | begin | |
34 | while (list <> nil) and (list^.car <> a) do list := list^.cdr; | |
35 | pmemq := list; | |
36 | end ; |