aboutsummaryrefslogtreecommitdiffhomepage
path: root/notes/generics_syntax_2023-05-13.txt
blob: 1bb368a3dbc459c4c36f5f84b66f8c3a49aac182 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45

typeparam keywords
------------------

    slot
    typeslot
    typevar
    genericslot
    genericvar
    
    typeparam
    generic
    type
    variant
    typename
    type32
    T,U,...
    %

    ref_or_int


Slot types
----------
A slot type can accept any of the following types:

    ref,string
    ?ref,?string
    byte,int8,wuint8
    int16,uint16,wuint16
    int32,uint32,wuint32    - unless \option allow16 is in use
    int,uint,wuint
    (int64,uint64,wuint64)  - only if \option use64 is in use

And maybe:
    float32       - but float64 will not work without \option use64


16-bit and 64-bit override
--------------------------

    \option allow16     - int/ref/slot can be 16 bit. affects maximum value.
    \option use64       - slot types can accept int64, but will use 64 bits
                          even on 32 bit platforms. Note that this breaks ABI!

use64 should perhaps introduce a new slot keyword, perhaps "slot64"?