diff options
| author | Kimplul <kimi.h.kuparinen@gmail.com> | 2024-02-20 02:18:36 +0200 |
|---|---|---|
| committer | Kimplul <kimi.h.kuparinen@gmail.com> | 2024-02-20 02:18:36 +0200 |
| commit | 89a907ddd0b7f6b888c61d54e3e41a8cee00b971 (patch) | |
| tree | e18577c5a1153a4c167290feb486c08d1aef3539 /hmm.t | |
| parent | b8eb76ef8efb2b000cb53d4d92d0c0df509cbdb8 (diff) | |
| download | ek-89a907ddd0b7f6b888c61d54e3e41a8cee00b971.tar.gz ek-89a907ddd0b7f6b888c61d54e3e41a8cee00b971.zip | |
expand type expansion
Diffstat (limited to 'hmm.t')
| -rw-r--r-- | hmm.t | 54 |
1 files changed, 0 insertions, 54 deletions
@@ -1,54 +0,0 @@ -/* common.ek */ -typedef any {} - -/* vec.ek */ -typedef vec { - i27 size; - i27 cap; - *any buf; -} - -insert(*vec v, i27 i, typeof(*v.buf) e) -{ - ... -} - -/* define local vector type */ -define vec!(t) -{ - struct vec [vec] {*t buf;} -} - -/* map.ek */ -typedef hashable { - /* pointers? */ - i27 hash(hashable); -} - -typedef map { - i27 size; - i27 cap; - *hashable keys; - *any values; -} - -// vs. append(*map h, typeof h.keys[0] k, typeof h.values[0] e) -// vs. append(*map h, ?h.keys[0] k, ?h.values[0] e) -// vs. append(*map h, #h.keys[0] k, #h.values[0] e) -// vs. append(*map h, :h.keys[0] k, :h.values[0] e) -// vs something else, hmm -append(*map h, `h.keys[0] k, `h.values[0] e) -{ - ... -} - -/* main.ek */ -main() -{ - vec!(i27) v; - // should automatically find the correct insert (unless the same - // elements as the vec typedef are used somewhere else) - insert(v, 0, 20); - // otherwise, force search as vec? - insert(v as vec, 0, 20); -} |
