6 #define AL_declare(this) ArrayList this; int this##_len = (0)
7 #define AL_init(this, n, default, T) \
10 this = buf_create(); \
12 for (int i = 0; i < this##_len; ++i) \
14 const _AL_type__##T() it = default; \
15 AL_set##T(this, i, it); \
19 #define AL_delete(this) buf_del(this)
21 #define _AL_type__s() string
22 #define AL_gets(this, idx) bufstr_get(this, idx)
23 #define AL_sets(this, idx, val) bufstr_set(this, idx, val)
25 #define _AL_type__f() float
26 #define AL_getf(this, idx) stof(AL_gets(this, idx))
27 #define AL_setf(this, idx, val) AL_sets(this, idx, ftos(val))
29 #define _AL_type__e() entity
30 #define AL_gete(this, idx) ftoe(AL_getf(this, idx))
31 #define AL_sete(this, idx, val) AL_setf(this, idx, etof(val))
33 #define AL_EACH(this, T, cond, body) \
36 const noref ArrayList _al = this; \
37 for (int i = 0, n = this##_len; i < n; ++i) \
39 const noref _AL_type__##T() it = AL_get##T(_al, i); \