aboutsummaryrefslogtreecommitdiffhomepage
path: root/notes/transitive_qualifiers.txt
blob: 6643a968061cdb61cd2fdbce733cb1977ec060af (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

Transitive qualifiers
=====================

In return types and local variables:

    func wrap_thing(ref Thing inner) -> ref var(if var inner) Wrapper
    {
        ref var(if var inner) wrapper = .new(inner)
        return wrapper
    }

Simplified syntax
-----------------
+ much more concise
+ probably much easier to implement
- limited to one ?var input
    - but can there ever be more than one?
    - and usually either all or none of the parameters would be const.
- maybe not as obvious
* what about things such as "?var ?aliased"? needs more qualfier bits.

    func wrap_thing(ref ?var Thing inner) -> ref ?var Wrapper
    {
        ref ?var wrapper = .new(inner)
        return wrapper
    }