aboutsummaryrefslogtreecommitdiffhomepage
path: root/notes/interface_inline.txt
blob: 7afd5ccd06a8fbd7492fb54651c182ca22c00af9 (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

Inline definitions in interfaces
================================

There are two use cases where definitions can be fully "exposed" in the
module interface:
1. Function bodies that are inlined
2. Constants

Both allow optimizations to be made. Exposed constants also allow the data
item to be used as a constant value (e.g. in array lengths).

(For constants, it could be emulated with enum constants.)


Problem:
- What should happen if the constant value or function body changes?
- Should changes be allowed at all?

Solutions
---------

Alt. 1: Simply forbid modification (without a version change)
    - Least surprises
    - Other languages already use lockfiles that lock the implementation
    - Changes must be versioned.