still mess, probably obsolete anyways

This commit is contained in:
2025-09-20 12:15:59 +03:00
parent 8e4cc98522
commit fe69fce67b
9 changed files with 80 additions and 5 deletions

25
example/polymorphism.sex Normal file
View File

@@ -0,0 +1,25 @@
(include stdint.h)
(struct vec2
((uint32_t x)
(uint32_t y)))
(trait gui
(fn void update ((float dt)))
(fn void render ())
(fn vec2 get-position ())
(fn void add-child ((gui *w))))
(struct button
((vector gui) children)
((vec2 pos)))
(impl gui button
(fn void update ((float dt))
())
(fn void render ()
())
(fn vec2 get-position ()
(return self->pos))
(fn void add-child ((gui *w))
(push self->children w)))