summaryrefslogtreecommitdiff
path: root/notes/simplified_ref_keywords.txt
blob: d649189d9502d851899af2e2e285cdf1628990ff (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
46
47
48
49


rwref vs var

   ref		ref
 rwref		ref var
 woref		ref writeonly
                 ^ forbid var directly on parameters (e.g. "var ref", "var int")
dedup, ptrmerge keyword

  dedup ref      - shorter
  ptrmerge ref   - explains what it does
  
  mergedref      - explains what it does


own and opt are similiar (if we use optref rather than ownref)


best(?) keywords so far:

    ref
    ref var
    ref writeonly
    mergedref           - target cannot be var or writeonly (or can it, on return types). intended to be used with generic types
    var
    var ref
    ownref
    ownref var
    ownref writeonly
    var ownref
    var ownref var
    var ownref writeonly
    
    - plus "uninit" which can go anywhere except directly on parameters
    - plus "aliased" and "threaded" which can go anywhere except directly on parameters (and local variables maybe?)
    - perhaps we should have an "optref" also? and optownref! but "mergedoptref" makes no sense
      or just use "?". which could be used with refs and enums

    ?ref
    ?ownref
    ?bool
    ?enumxx

it can get quite long, though:

    ref var threaded
    var ref writeonly threaded