blob: 4b4513baed6b96db4362c7fbd820d7c6e973edab (
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
|
Use case 1: Form
typedef User = struct(
String* email,
String* password,
);
typedef Form[User] =
Use case 2: Custom control
// editable data, with "instant-apply"
namespace DateEditor = (
typedef = struct(
InstantEditableData[Date] base,
)
(DateEditor* this) new(Date* date) {
this = alloc(DateEditor);
this.init(date);
}
(DateEditor* this) init(DateEditor* this, Date* date) {
this.base.init();
this.date = date;
}
(DateEditor*? this) new(DateEditor*? target, Date* date) {
this = (target != null ? this : alloc(DateEditor));
this.base.init(this);
this.date = date;
}
)
Use case 2:
|