Changes between Version 18 and Version 19 of PIL


Ignore:
Timestamp:
10/16/24 13:17:47 (19 months ago)
Author:
siegel
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • PIL

    v18 v19  
    2929
    3030== Types
    31 - '''type names''' are used for all declarations.  There are no C declarators.  Examples:
     31
     32=== Basic properties of types
     33
     34'''type names''' are used for all declarations.  There are no C declarators.  Examples:
    3235 * `$int[] a`: declares `a` to be an array of integer
    3336 * `$int* p`: pointer to integer
     
    3538 * `$int[]* q`: pointer to array of integer
    3639 * `$int*[]($real) f`: function from Real to array of pointer to integer
    37 - every type has a default value.  The result of evaluating an erroneous expression is the default value of that type.  (But as explained above, an analyzer may check for all errors.)
     40
     41Type definitions have the form: `typedef typename ID;`.
     42
     43Every type has a default value.  The result of evaluating an erroneous expression is the default value of that type.  (But as explained above, an analyzer may check for all errors.)
     44
     45=== The types
     46
    3847- basic types:
    3948 * `$bool` : the set consisting of `$true` and `$false`.  Default value: `$false`.
     
    5261- `$map<T1,T2>` : finite map from `T1` to `T2`.  A map is a set of ordered pairs `(x,y)` with the property that if `(x,y)` and `(x,z)` are in the map, then `y`=`z`.  Default value: the empty map.
    5362- `$tuple<T1,...>` : tuples of specified type.  This is similar to `struct`, but there is no tag and the fields do not have names.  Default value: the tuple in which each component has its default value.
    54 - Type definitions have the form: `typedef typename ID;`
     63- `$obj` : the object type.   This is a type for representing a sequence of bytes holding arbitrary values at different intervals.   It is used to model C objects, such as the object created by a call to C's `malloc`.
     64
     65=== Sized types
     66
     67The types above are the ''unsized types''  A ''sized type'' comprises an unsized type and a positive integer, which represents the size of the type in bytes.  Syntactically, a sized type is specified
     68{{{
     69  $size(expr) typename
     70}}}
     71where expr is an integer constant expression and typename is the name of an unsized type.  For example,
     72{{{
     73typedef $size(4) $int int;
     74typedef $size(8) $int long;
     75typedef $size(4) $real float;
     76typedef $size(8) $real double;
     77}}}
     78defines 4 distinct types.  Certain operations require a sized type.
     79
    5580
    5681== Functions
     
    289314 * frees the object referred to by `p`, the pointer returned by an earlier call to `$new` or `$alloc`.
    290315
     316== Objects
     317
     318The following operations are supported on the `$obj` type:
     319
     320
     321
    291322
    292323== Questions