13 |
Description: |
Description: |
14 |
|
|
15 |
---------------------------------------------------------------------- |
---------------------------------------------------------------------- |
16 |
|
Name: Matthias Blume |
17 |
|
Date: 2002/02/26 12:00:00 EST |
18 |
|
Tag: blume-20020226-ffi |
19 |
|
Description: |
20 |
|
|
21 |
|
1. Fixed a minor bug in CM's "noweb" tool: |
22 |
|
If numbering is turned off, then truly don't number (i.e., do not |
23 |
|
supply the -L option to noweb). The previous behavior was to supply |
24 |
|
-L'' -- which caused noweb to use the "default" line numbering scheme. |
25 |
|
Thanks to Chris Richards for pointing this out (and supplying the fix). |
26 |
|
|
27 |
|
2. Once again, I reworked some aspects of the FFI: |
28 |
|
|
29 |
|
A. The incomplete/complete type business: |
30 |
|
|
31 |
|
- Signatures POINTER_TO_INCOMPLETE_TYPE and accompanying functors are |
32 |
|
gone! |
33 |
|
- ML types representing an incomplete type are now *equal* to |
34 |
|
ML types representing their corresponding complete types (just like |
35 |
|
in C). This is still safe because ml-nlffigen will not generate |
36 |
|
RTTI for incomplete types, nor will it generate functions that |
37 |
|
require access to such RTTI. But when ML code generated from both |
38 |
|
incomplete and complete versions of the C type meet, the ML types |
39 |
|
are trivially interoperable. |
40 |
|
|
41 |
|
NOTE: These changes restore the full generality of the translation |
42 |
|
(which was previously lost when I eliminated functorization)! |
43 |
|
|
44 |
|
B. Enum types: |
45 |
|
|
46 |
|
- Structure C now has a type constructor "enum" that is similar to |
47 |
|
how the "su" constructor works. However, "enum" is not a phantom |
48 |
|
type because each "T enum" has values (and is isomorphic to |
49 |
|
MLRep.Signed.int). |
50 |
|
- There are generic access operations for enum objects (using |
51 |
|
MLRep.Signed.int). |
52 |
|
- ml-nlffigen will generate a structure E_foo for each "enum foo". |
53 |
|
* The structure contains the definition of type "mlrep" (the ML-side |
54 |
|
representation type of the enum). Normally, mlrep is the same |
55 |
|
as "MLRep.Signed.int", but if ml-nlffigen was invoked with "-ec", |
56 |
|
then mlrep will be defined as a datatype -- thus facilitating |
57 |
|
pattern matching on mlrep values. |
58 |
|
("-ec" will be suppressed if there are duplicate values in an |
59 |
|
enumeration.) |
60 |
|
* Constructors ("-ec") or values (no "-ec") e_xxx of type mlrep |
61 |
|
will be generated for each C enum constant xxx. |
62 |
|
* Conversion functions m2i and i2m convert between mlrep and |
63 |
|
MLRep.Signed.int. (Without "-ec", these functions are identities.) |
64 |
|
* Coversion functions c and ml convert between mlrep and "tag enum". |
65 |
|
* Access functions (get/set) fetch and store mlrep values. |
66 |
|
- By default (unless ml-nlffigen was invoked with "-nocollect"), unnamed |
67 |
|
enumerations are merged into one single enumeration represented by |
68 |
|
structure E_'. |
69 |
|
|
70 |
|
---------------------------------------------------------------------- |
71 |
Name: Allen Leung |
Name: Allen Leung |
72 |
Date: 2002/02/25 04:45:00 EST |
Date: 2002/02/25 04:45:00 EST |
73 |
Tag: leunga-20020225-cps-spill |
Tag: leunga-20020225-cps-spill |