diff --git a/.gitignore b/.gitignore
index dec0999..c56c58a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -32,16 +32,24 @@ libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo_cov
libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo_debug
libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo.app/Contents/MacOS
libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo.app/Contents/Frameworks
+libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo.app/Contents/fonts
libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo.app/Contents/img
+libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo.app/Contents/lib
libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo_asan.app/Contents/MacOS
libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo_asan.app/Contents/Frameworks
+libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo_asan.app/Contents/fonts
libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo_asan.app/Contents/img
+libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo_asan.app/Contents/lib
libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo_cov.app/Contents/MacOS
libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo_cov.app/Contents/Frameworks
+libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo_cov.app/Contents/fonts
libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo_cov.app/Contents/img
+libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo_cov.app/Contents/lib
libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo_debug.app/Contents/MacOS
libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo_debug.app/Contents/Frameworks
+libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo_debug.app/Contents/fonts
libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo_debug.app/Contents/img
+libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo_debug.app/Contents/lib
libc3/window/cairo/xcb/demo/c3_window_cairo_xcb_demo
libc3/window/cairo/xcb/demo/c3_window_cairo_xcb_demo_asan
libc3/window/cairo/xcb/demo/c3_window_cairo_xcb_demo_cov
diff --git a/ic3/Makefile b/ic3/Makefile
index 8a6a936..c8dbc3a 100644
--- a/ic3/Makefile
+++ b/ic3/Makefile
@@ -50,7 +50,21 @@ install:
mkdir -p ${prefix}/bin
install -m 755 ic3 ${prefix}/bin/ic3
-.PHONY: all asan cov debug clean clean_cov distclean
+lldb_ic3: debug
+ if [ -f ic3_debug.core ]; then lldb .libs/ic3_debug ic3_debug.core; else lldb .libs/ic3_debug; fi
+
+.PHONY: \
+ all \
+ asan \
+ clean \
+ clean_cov \
+ cov \
+ debug \
+ distclean \
+ gdb_ic3 \
+ install \
+ lldb_ic3 \
+ update_sources \
include config.mk
include sources.mk
diff --git a/lib/c3/0.1/ptr_free.facts b/lib/c3/0.1/ptr_free.facts
new file mode 100644
index 0000000..b426783
--- /dev/null
+++ b/lib/c3/0.1/ptr_free.facts
@@ -0,0 +1,5 @@
+%{module: C3.Facts.Dump,
+ version: 1}
+replace {PtrFree, :is_a, :module}
+replace {PtrFree, :symbol, PtrFree.cast}
+replace {PtrFree.cast, :cfn, cfn PtrFree "ptr_free_cast" (Tag, Result)}
diff --git a/libc3/env.c b/libc3/env.c
index 4bf50cd..4362bdb 100644
--- a/libc3/env.c
+++ b/libc3/env.c
@@ -789,13 +789,14 @@ s_env * env_init (s_env *env, int argc, s8 **argv)
return env;
}
-const s_list * env_get_struct_type_spec (s_env *env,
- const s_sym *module)
+s_list ** env_get_struct_type_spec (s_env *env, const s_sym *module,
+ s_list **dest)
{
s_facts_cursor cursor;
s_tag tag_defstruct;
s_tag tag_module;
s_tag tag_var;
+ s_tag tmp;
tag_init_sym_1(&tag_defstruct, "defstruct");
tag_init_sym(&tag_module, module);
tag_init_var(&tag_var);
@@ -806,16 +807,23 @@ const s_list * env_get_struct_type_spec (s_env *env,
warnx("env_get_struct_type_spec: module %s"
" does not use defstruct",
module->str.ptr.ps8);
+ facts_cursor_clean(&cursor);
return NULL;
}
- if (tag_var.type != TAG_LIST ||
- ! list_is_plist(tag_var.data.list)) {
+ facts_cursor_clean(&cursor);
+ if (! env_eval_tag(env, &tag_var, &tmp))
+ return NULL;
+ tag_clean(&tag_var);
+ if (tmp.type != TAG_LIST ||
+ ! list_is_plist(tmp.data.list)) {
warnx("env_get_struct_type_spec: module %s"
" has a defstruct that is not a property list",
module->str.ptr.ps8);
+ tag_clean(&tmp);
return NULL;
}
- return tag_var.data.list;
+ *dest = tmp.data.list;
+ return dest;
}
s_env * env_init_args (s_env *env, int argc, s8 **argv)
diff --git a/libc3/env.h b/libc3/env.h
index 34cc7f6..d9f4b98 100644
--- a/libc3/env.h
+++ b/libc3/env.h
@@ -21,10 +21,6 @@ extern s_env g_c3_env;
void env_clean (s_env *env);
s_env * env_init (s_env *env, int argc, s8 **argv);
-/* Observers. */
-const s_list * env_get_struct_type_spec (s_env *env,
- const s_sym *module);
-
/* Operators. */
bool env_eval_array (s_env *env, const s_array *array,
s_array *dest);
@@ -64,6 +60,8 @@ bool env_eval_struct (s_env *env, const s_struct *s,
bool env_eval_tag (s_env *env, const s_tag *tag, s_tag *dest);
bool env_eval_tuple (s_env *env, const s_tuple *tuple,
s_tag *dest);
+s_list ** env_get_struct_type_spec (s_env *env, const s_sym *module,
+ s_list **dest);
bool env_module_load (s_env *env, const s_sym *module,
s_facts *facts);
bool env_module_maybe_reload (s_env *env, const s_sym *module,
diff --git a/libc3/ptr_free.c b/libc3/ptr_free.c
index 27dfa1b..1c758cc 100644
--- a/libc3/ptr_free.c
+++ b/libc3/ptr_free.c
@@ -13,7 +13,37 @@
#include <assert.h>
#include <err.h>
#include <stdlib.h>
+#include "integer.h"
#include "ptr_free.h"
+#include "tag_type.h"
+
+u_ptr_w * ptr_free_cast (const s_tag *tag, u_ptr_w *dest)
+{
+ assert(tag);
+ assert(dest);
+ switch (tag->type) {
+ case TAG_F32: dest->p = (void *) ((uw) tag->data.f32); return dest;
+ case TAG_F64: dest->p = (void *) ((uw) tag->data.f64); return dest;
+ case TAG_INTEGER:
+ dest->p = (void *) integer_to_uw(&tag->data.integer); return dest;
+ case TAG_PTR: dest->p = tag->data.ptr.p; return dest;
+ case TAG_PTR_FREE: dest->p = tag->data.ptr_free.p; return dest;
+ case TAG_S8: dest->p = (void *) ((uw) tag->data.s8); return dest;
+ case TAG_S16: dest->p = (void *) ((uw) tag->data.s16); return dest;
+ case TAG_S32: dest->p = (void *) ((uw) tag->data.s32); return dest;
+ case TAG_S64: dest->p = (void *) ((uw) tag->data.s64); return dest;
+ case TAG_SW: dest->p = (void *) ((uw) tag->data.sw); return dest;
+ case TAG_U8: dest->p = (void *) ((uw) tag->data.u8); return dest;
+ case TAG_U16: dest->p = (void *) ((uw) tag->data.u16); return dest;
+ case TAG_U32: dest->p = (void *) ((uw) tag->data.u32); return dest;
+ case TAG_U64: dest->p = (void *) ((uw) tag->data.u64); return dest;
+ case TAG_UW: dest->p = (void *) ((uw) tag->data.uw); return dest;
+ default: break;
+ }
+ warnx("ptr_free_cast: cannot cast %s to PtrFree",
+ tag_type_to_string(tag->type));
+ return NULL;
+}
void ptr_free_clean (u_ptr_w *ptr_free)
{
diff --git a/libc3/struct_type.c b/libc3/struct_type.c
index 2d828ba..da47dcc 100644
--- a/libc3/struct_type.c
+++ b/libc3/struct_type.c
@@ -109,15 +109,18 @@ s_struct_type * struct_type_init_from_env (s_struct_type *st,
const s_sym *module,
s_env *env)
{
- const s_list *spec;
+ s_list *spec;
assert(st);
assert(module);
assert(env);
- spec = env_get_struct_type_spec(env, module);
- if (! spec)
+ if (! env_get_struct_type_spec(env, module, &spec) ||
+ ! spec)
return NULL;
- if (! struct_type_init(st, module, spec))
+ if (! struct_type_init(st, module, spec)) {
+ list_delete_all(spec);
return NULL;
+ }
+ list_delete_all(spec);
return st;
}
diff --git a/libc3/sym.c b/libc3/sym.c
index 0820139..29d4c51 100644
--- a/libc3/sym.c
+++ b/libc3/sym.c
@@ -374,6 +374,8 @@ f_clean sym_to_clean (const s_sym *type)
return (f_clean) tuple_clean;
if (type == sym_1("Var"))
return NULL;
+ if (type == sym_1("Void"))
+ return NULL;
err_write_1("sym_to_clean: unknown type: ");
err_write_1(type->str.ptr.ps8);
err_write_1("\n");
@@ -403,6 +405,10 @@ ffi_type * sym_to_ffi_type (const s_sym *sym, ffi_type *result_type)
return &ffi_type_pointer;
if (sym == sym_1("Map"))
return &ffi_type_pointer;
+ if (sym == sym_1("Ptr"))
+ return &ffi_type_pointer;
+ if (sym == sym_1("PtrFree"))
+ return &ffi_type_pointer;
if (sym == sym_1("S8"))
return &ffi_type_sint8;
if (sym == sym_1("S16"))
@@ -482,6 +488,10 @@ f_init_copy sym_to_init_copy (const s_sym *type)
return (f_init_copy) uw_init_copy;
if (type == sym_1("Ptag"))
return (f_init_copy) ptag_init_copy;
+ if (type == sym_1("Ptr"))
+ return (f_init_copy) ptr_init_copy;
+ if (type == sym_1("PtrFree"))
+ return (f_init_copy) ptr_free_init_copy;
if (type == sym_1("Quote"))
return (f_init_copy) quote_init_copy;
if (type == sym_1("Str"))
@@ -501,10 +511,6 @@ f_init_copy sym_to_init_copy (const s_sym *type)
bool sym_to_tag_type (const s_sym *sym, e_tag_type *dest)
{
- if (sym->str.ptr.ps8[sym->str.size - 2] == '*') {
- *dest = TAG_PTR;
- return true;
- }
if (sym == sym_1("Void")) {
*dest = TAG_VOID;
return true;
@@ -545,72 +551,80 @@ bool sym_to_tag_type (const s_sym *sym, e_tag_type *dest)
*dest = TAG_INTEGER;
return true;
}
- if (sym == sym_1("Sw")) {
- *dest = TAG_SW;
+ if (sym == sym_1("List")) {
+ *dest = TAG_LIST;
return true;
}
- if (sym == sym_1("S64")) {
- *dest = TAG_S64;
+ if (sym == sym_1("Ptag")) {
+ *dest = TAG_PTAG;
return true;
}
- if (sym == sym_1("S32")) {
- *dest = TAG_S32;
+ if (sym == sym_1("Ptr")) {
+ *dest = TAG_PTR;
return true;
}
- if (sym == sym_1("S16")) {
- *dest = TAG_S16;
+ if (sym == sym_1("PtrFree")) {
+ *dest = TAG_PTR_FREE;
+ return true;
+ }
+ if (sym == sym_1("Quote")) {
+ *dest = TAG_QUOTE;
return true;
}
if (sym == sym_1("S8")) {
*dest = TAG_S8;
return true;
}
- if (sym == sym_1("U8")) {
- *dest = TAG_U8;
+ if (sym == sym_1("S16")) {
+ *dest = TAG_S16;
return true;
}
- if (sym == sym_1("U16")) {
- *dest = TAG_U16;
+ if (sym == sym_1("S32")) {
+ *dest = TAG_S32;
return true;
}
- if (sym == sym_1("U32")) {
- *dest = TAG_U32;
+ if (sym == sym_1("S64")) {
+ *dest = TAG_S64;
return true;
}
- if (sym == sym_1("U64")) {
- *dest = TAG_U64;
+ if (sym == sym_1("Str")) {
+ *dest = TAG_STR;
return true;
}
- if (sym == sym_1("Uw")) {
- *dest = TAG_UW;
+ if (sym == sym_1("Sw")) {
+ *dest = TAG_SW;
return true;
}
- if (sym == sym_1("List")) {
- *dest = TAG_LIST;
+ if (sym == sym_1("Sym")) {
+ *dest = TAG_SYM;
return true;
}
- if (sym == sym_1("Ptag")) {
- *dest = TAG_PTAG;
+ if (sym == sym_1("Tag")) {
+ *dest = TAG_VOID;
return true;
}
- if (sym == sym_1("Quote")) {
- *dest = TAG_QUOTE;
+ if (sym == sym_1("Tuple")) {
+ *dest = TAG_TUPLE;
return true;
}
- if (sym == sym_1("Str")) {
- *dest = TAG_STR;
+ if (sym == sym_1("U8")) {
+ *dest = TAG_U8;
return true;
}
- if (sym == sym_1("Sym")) {
- *dest = TAG_SYM;
+ if (sym == sym_1("U16")) {
+ *dest = TAG_U16;
return true;
}
- if (sym == sym_1("Tag")) {
- *dest = TAG_VOID;
+ if (sym == sym_1("U32")) {
+ *dest = TAG_U32;
return true;
}
- if (sym == sym_1("Tuple")) {
- *dest = TAG_TUPLE;
+ if (sym == sym_1("U64")) {
+ *dest = TAG_U64;
+ return true;
+ }
+ if (sym == sym_1("Uw")) {
+ *dest = TAG_UW;
return true;
}
err_write_1("sym_to_tag_type: unknown type: ");
@@ -642,40 +656,46 @@ uw sym_type_size (const s_sym *type)
return sizeof(s_ident);
if (type == sym_1("Integer"))
return sizeof(s_integer);
- if (type == sym_1("Sw"))
- return sizeof(sw);
- if (type == sym_1("S64"))
- return sizeof(s64);
- if (type == sym_1("S32"))
- return sizeof(s32);
- if (type == sym_1("S16"))
- return sizeof(s16);
- if (type == sym_1("S8"))
- return sizeof(s8);
- if (type == sym_1("U8"))
- return sizeof(u8);
- if (type == sym_1("U16"))
- return sizeof(u16);
- if (type == sym_1("U32"))
- return sizeof(u32);
- if (type == sym_1("U64"))
- return sizeof(u64);
- if (type == sym_1("Uw"))
- return sizeof(uw);
if (type == sym_1("List"))
return sizeof(s_list *);
if (type == sym_1("Ptag"))
return sizeof(p_tag);
+ if (type == sym_1("Ptr"))
+ return sizeof(void *);
+ if (type == sym_1("PtrFree"))
+ return sizeof(void *);
if (type == sym_1("Quote"))
return sizeof(s_quote);
+ if (type == sym_1("S8"))
+ return sizeof(s8);
+ if (type == sym_1("S16"))
+ return sizeof(s16);
+ if (type == sym_1("S32"))
+ return sizeof(s32);
+ if (type == sym_1("S64"))
+ return sizeof(s64);
if (type == sym_1("Str"))
return sizeof(s_str);
+ if (type == sym_1("Sw"))
+ return sizeof(sw);
if (type == sym_1("Sym"))
return sizeof(s_sym *);
if (type == sym_1("Tuple"))
return sizeof(s_tuple);
+ if (type == sym_1("U8"))
+ return sizeof(u8);
+ if (type == sym_1("U16"))
+ return sizeof(u16);
+ if (type == sym_1("U32"))
+ return sizeof(u32);
+ if (type == sym_1("U64"))
+ return sizeof(u64);
+ if (type == sym_1("Uw"))
+ return sizeof(uw);
if (type == sym_1("Var"))
return sizeof(s_tag);
+ if (type == sym_1("Void"))
+ return 0;
err_write_1("sym_type_size: unknown type: ");
err_write_1(type->str.ptr.ps8);
err_write_1("\n");
diff --git a/libc3/window/cairo/quartz/demo/Makefile b/libc3/window/cairo/quartz/demo/Makefile
index a775c59..69978d0 100644
--- a/libc3/window/cairo/quartz/demo/Makefile
+++ b/libc3/window/cairo/quartz/demo/Makefile
@@ -25,11 +25,16 @@ IMG_SOURCES = \
../../../../../img/fly-noto.png \
../../../../../img/toast.png \
+FONT_SOURCES = \
+ ../../../../../fonts/Computer-Modern \
+ ../../../../../fonts/Courier\ New \
+
build:
${MAKE} ${APP_PROG}
${MAKE} ${APP}/Contents/Frameworks
- rsync -aP --delete ../../../../../lib ${APP}/Contents/
+ rsync -aP ${FONT_SOURCES} ${APP}/Contents/fonts/
rsync -aP ${IMG_SOURCES} ${APP}/Contents/img/
+ rsync -aP --delete ../../../../../lib ${APP}/Contents/
all:
${MAKE} build
@@ -40,8 +45,9 @@ all:
asan:
${MAKE} ${APP_PROG_ASAN}
${MAKE} ${APP_ASAN}/Contents/Frameworks
- rsync -aP --delete ../../../../../lib ${APP_ASAN}/Contents/
+ rsync -aP ${FONT_SOURCES} ${APP_ASAN}/Contents/fonts/
rsync -aP ${IMG_SOURCES} ${APP_ASAN}/Contents/img/
+ rsync -aP --delete ../../../../../lib ${APP_ASAN}/Contents/
clean:
rm -rf ${CLEANFILES}
@@ -52,14 +58,16 @@ clean_cov:
cov:
${MAKE} ${APP_PROG_COV}
${MAKE} ${APP_COV}/Contents/Frameworks
- rsync -aP --delete ../../../../../lib ${APP_COV}/Contents/
+ rsync -aP ${FONT_SOURCES} ${APP_COV}/Contents/fonts/
rsync -aP ${IMG_SOURCES} ${APP_COV}/Contents/img/
+ rsync -aP --delete ../../../../../lib ${APP_COV}/Contents/
debug:
${MAKE} ${APP_PROG_DEBUG}
${MAKE} ${APP_DEBUG}/Contents/Frameworks
- rsync -aP --delete ../../../../../lib ${APP_DEBUG}/Contents/
+ rsync -aP ${FONT_SOURCES} ${APP_DEBUG}/Contents/fonts/
rsync -aP ${IMG_SOURCES} ${APP_DEBUG}/Contents/img/
+ rsync -aP --delete ../../../../../lib ${APP_DEBUG}/Contents/
demo: build
time ${APP_PROG}
diff --git a/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo.app/Contents/lib/c3/0.1/array.facts b/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo.app/Contents/lib/c3/0.1/array.facts
deleted file mode 100644
index 4bcb97c..0000000
--- a/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo.app/Contents/lib/c3/0.1/array.facts
+++ /dev/null
@@ -1,5 +0,0 @@
-%{module: C3.Facts.Dump,
- version: 1}
-add {Array, :is_a, :module}
-add {Array, :symbol, Array.data}
-replace {Array.data, :cfn, cfn :tag "array_data_tag" (:tag, :tag, :&result)}
diff --git a/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo.app/Contents/lib/c3/0.1/c3.facts b/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo.app/Contents/lib/c3/0.1/c3.facts
deleted file mode 100644
index 0bdbba9..0000000
--- a/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo.app/Contents/lib/c3/0.1/c3.facts
+++ /dev/null
@@ -1,188 +0,0 @@
-%{module: C3.Facts.Dump,
- version: 1}
-replace {C3, :is_a, :module}
-replace {C3, :operator, C3.operator00}
-replace {C3.operator00, :is_a, :operator}
-replace {C3.operator00, :symbol, :"()"}
-replace {C3.operator00, :arity, 1}
-replace {C3.operator00, :cfn, cfn Tag "tag_paren" (Tag, Result)}
-replace {C3.operator00, :operator_precedence, 13}
-replace {C3.operator00, :operator_associativity, :left}
-add {C3, :operator, C3.operator01}
-replace {C3.operator01, :is_a, :operator}
-replace {C3.operator01, :symbol, :"[]"}
-replace {C3.operator01, :arity, 2}
-replace {C3.operator01, :cfn, cfn Tag "tag_brackets" (Tag, Tag, Result)}
-replace {C3.operator01, :operator_precedence, 13}
-replace {C3.operator01, :operator_associativity, :left}
-add {C3, :operator, C3.operator02}
-replace {C3.operator02, :is_a, :operator}
-replace {C3.operator02, :symbol, :!}
-replace {C3.operator02, :arity, 1}
-replace {C3.operator02, :cfn, cfn Bool "tag_not" (Tag, Result)}
-replace {C3.operator02, :operator_precedence, 12}
-replace {C3.operator02, :operator_associativity, :right}
-add {C3, :operator, C3.operator03}
-replace {C3.operator03, :is_a, :operator}
-replace {C3.operator03, :symbol, :~}
-replace {C3.operator03, :arity, 1}
-replace {C3.operator03, :cfn, cfn Tag "tag_bnot" (Tag, Result)}
-replace {C3.operator03, :operator_precedence, 12}
-replace {C3.operator03, :operator_associativity, :right}
-add {C3, :operator, C3.operator04}
-replace {C3.operator04, :is_a, :operator}
-replace {C3.operator04, :symbol, :-}
-replace {C3.operator04, :arity, 1}
-replace {C3.operator04, :cfn, cfn Tag "tag_neg" (Tag, Result)}
-replace {C3.operator04, :operator_precedence, 12}
-replace {C3.operator04, :operator_associativity, :right}
-add {C3, :operator, C3.operator05}
-replace {C3.operator05, :is_a, :operator}
-replace {C3.operator05, :symbol, :*}
-replace {C3.operator05, :arity, 2}
-replace {C3.operator05, :cfn, cfn Tag "tag_mul" (Tag, Tag, Result)}
-replace {C3.operator05, :operator_precedence, 11}
-replace {C3.operator05, :operator_associativity, :left}
-add {C3, :operator, C3.operator06}
-replace {C3.operator06, :is_a, :operator}
-replace {C3.operator06, :symbol, :/}
-replace {C3.operator06, :arity, 2}
-replace {C3.operator06, :cfn, cfn Tag "tag_div" (Tag, Tag, Result)}
-replace {C3.operator06, :operator_precedence, 11}
-replace {C3.operator06, :operator_associativity, :left}
-add {C3, :operator, C3.operator07}
-replace {C3.operator07, :is_a, :operator}
-replace {C3.operator07, :symbol, :mod}
-replace {C3.operator07, :arity, 2}
-replace {C3.operator07, :cfn, cfn Tag "tag_mod" (Tag, Tag, Result)}
-replace {C3.operator07, :operator_precedence, 11}
-replace {C3.operator07, :operator_associativity, :left}
-add {C3, :operator, C3.operator08}
-replace {C3.operator08, :is_a, :operator}
-replace {C3.operator08, :symbol, :+}
-replace {C3.operator08, :arity, 2}
-replace {C3.operator08, :cfn, cfn Tag "tag_add" (Tag, Tag, Result)}
-replace {C3.operator08, :operator_precedence, 10}
-replace {C3.operator08, :operator_associativity, :left}
-add {C3, :operator, C3.operator09}
-replace {C3.operator09, :is_a, :operator}
-replace {C3.operator09, :symbol, :-}
-replace {C3.operator09, :arity, 2}
-replace {C3.operator09, :cfn, cfn Tag "tag_sub" (Tag, Tag, Result)}
-replace {C3.operator09, :operator_precedence, 10}
-replace {C3.operator09, :operator_associativity, :left}
-add {C3, :operator, C3.operator10}
-replace {C3.operator10, :is_a, :operator}
-replace {C3.operator10, :symbol, :<<}
-replace {C3.operator10, :arity, 2}
-replace {C3.operator10, :cfn, cfn Tag "tag_shift_left" (Tag, Tag, Result)}
-replace {C3.operator10, :operator_precedence, 9}
-replace {C3.operator10, :operator_associativity, :left}
-add {C3, :operator, C3.operator11}
-replace {C3.operator11, :is_a, :operator}
-replace {C3.operator11, :symbol, :>>}
-replace {C3.operator11, :arity, 2}
-replace {C3.operator11, :cfn, cfn Tag "tag_shift_right" (Tag, Tag, Result)}
-replace {C3.operator11, :operator_precedence, 9}
-replace {C3.operator11, :operator_associativity, :left}
-add {C3, :operator, C3.operator12}
-replace {C3.operator12, :is_a, :operator}
-replace {C3.operator12, :symbol, :<}
-replace {C3.operator12, :arity, 2}
-replace {C3.operator12, :cfn, cfn Bool "tag_lt" (Tag, Tag, Result)}
-replace {C3.operator12, :operator_precedence, 8}
-replace {C3.operator12, :operator_associativity, :left}
-add {C3, :operator, C3.operator13}
-replace {C3.operator13, :symbol, :<=}
-replace {C3.operator13, :is_a, :operator}
-replace {C3.operator13, :arity, 2}
-replace {C3.operator13, :cfn, cfn Bool "tag_lte" (Tag, Tag, Result)}
-replace {C3.operator13, :operator_precedence, 8}
-replace {C3.operator13, :operator_associativity, :left}
-add {C3, :operator, C3.operator14}
-replace {C3.operator14, :symbol, :>}
-replace {C3.operator14, :is_a, :operator}
-replace {C3.operator14, :arity, 2}
-replace {C3.operator14, :cfn, cfn Bool "tag_gt" (Tag, Tag, Result)}
-replace {C3.operator14, :operator_precedence, 8}
-replace {C3.operator14, :operator_associativity, :left}
-add {C3, :operator, C3.operator15}
-replace {C3.operator15, :symbol, :>=}
-replace {C3.operator15, :is_a, :operator}
-replace {C3.operator15, :arity, 2}
-replace {C3.operator15, :cfn, cfn Bool "tag_gte" (Tag, Tag, Result)}
-replace {C3.operator15, :operator_precedence, 8}
-replace {C3.operator15, :operator_associativity, :left}
-add {C3, :operator, C3.operator16}
-replace {C3.operator16, :is_a, :operator}
-replace {C3.operator16, :symbol, :==}
-replace {C3.operator16, :arity, 2}
-replace {C3.operator16, :cfn, cfn Bool "tag_eq" (Tag, Tag, Result)}
-replace {C3.operator16, :operator_precedence, 7}
-replace {C3.operator16, :operator_associativity, :left}
-add {C3, :operator, C3.operator17}
-replace {C3.operator17, :is_a, :operator}
-replace {C3.operator17, :symbol, :!=}
-replace {C3.operator17, :arity, 2}
-replace {C3.operator17, :cfn, cfn Bool "tag_not_eq" (Tag, Tag, Result)}
-replace {C3.operator17, :operator_precedence, 7}
-replace {C3.operator17, :operator_associativity, :left}
-add {C3, :operator, C3.operator18}
-replace {C3.operator18, :is_a, :operator}
-replace {C3.operator18, :symbol, :&}
-replace {C3.operator18, :arity, 2}
-replace {C3.operator18, :cfn, cfn Tag "tag_band" (Tag, Tag, Result)}
-replace {C3.operator18, :operator_precedence, 6}
-replace {C3.operator18, :operator_associativity, :left}
-add {C3, :operator, C3.operator19}
-replace {C3.operator19, :is_a, :operator}
-replace {C3.operator19, :symbol, :^}
-replace {C3.operator19, :arity, 2}
-replace {C3.operator19, :cfn, cfn Tag "tag_bxor" (Tag, Tag, Result)}
-replace {C3.operator19, :operator_precedence, 5}
-replace {C3.operator19, :operator_associativity, :left}
-add {C3, :operator, C3.operator20}
-replace {C3.operator20, :is_a, :operator}
-replace {C3.operator20, :symbol, :bor}
-replace {C3.operator20, :arity, 2}
-replace {C3.operator20, :cfn, cfn Tag "tag_bor" (Tag, Tag, Result)}
-replace {C3.operator20, :operator_precedence, 4}
-replace {C3.operator20, :operator_associativity, :left}
-add {C3, :operator, C3.operator21}
-replace {C3.operator21, :is_a, :operator}
-replace {C3.operator21, :symbol, :&&}
-replace {C3.operator21, :arity, 2}
-replace {C3.operator21, :cfn, cfn Bool "tag_and" (Tag, Tag, Result)}
-replace {C3.operator21, :operator_precedence, 3}
-replace {C3.operator21, :operator_associativity, :left}
-add {C3, :operator, C3.operator22}
-replace {C3.operator22, :is_a, :operator}
-replace {C3.operator22, :symbol, :||}
-replace {C3.operator22, :arity, 2}
-replace {C3.operator22, :cfn, cfn Bool "tag_or" (Tag, Tag, Result)}
-replace {C3.operator22, :operator_precedence, 2}
-replace {C3.operator22, :operator_associativity, :left}
-add {C3, :operator, C3.operator23}
-replace {C3.operator23, :is_a, :operator}
-add {C3.operator23, :is_a, :special_operator}
-replace {C3.operator23, :symbol, :=}
-replace {C3.operator23, :arity, 2}
-replace {C3.operator23, :cfn, cfn Tag "tag_equal" (Tag, Tag, Result)}
-replace {C3.operator23, :operator_precedence, 1}
-replace {C3.operator23, :operator_associativity, :right}
-replace {C3.break, :cfn, cfn Void "c3_break" ()}
-replace {C3, :symbol, C3.first}
-replace {C3.first, :fn, fn {
- ([a | _b]) { a }
- ({a, _b}) { a }
- ({a, _b, _c}) { a }
- ({a, _b, _c, _d}) { a }
-}}
-add {C3, :symbol, C3.license}
-replace {C3.license, :cfn, cfn Void "c3_license" ()}
-add {C3, :symbol, C3.type}
-replace {C3.type, :cfn, cfn Sym "tag_type" (Tag, Result)}
-add {C3, :symbol, C3.fib}
-replace {C3.fib, :fn, fn { (0) { 1 }
- (1) { 1 }
- (x) { fib(x - 1) + fib(x - 2) } }}
diff --git a/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo.app/Contents/lib/c3/0.1/integer.facts b/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo.app/Contents/lib/c3/0.1/integer.facts
deleted file mode 100644
index ff8d8e7..0000000
--- a/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo.app/Contents/lib/c3/0.1/integer.facts
+++ /dev/null
@@ -1,5 +0,0 @@
-%{module: C3.Facts.Dump,
- version: 1}
-replace {Integer, :is_a, :module}
-replace {Integer, :symbol, Integer.cast}
-replace {Integer.cast, :cfn, cfn Integer "integer_cast" (Tag, Result)}
diff --git a/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo.app/Contents/lib/c3/0.1/list.facts b/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo.app/Contents/lib/c3/0.1/list.facts
deleted file mode 100644
index ea05f14..0000000
--- a/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo.app/Contents/lib/c3/0.1/list.facts
+++ /dev/null
@@ -1,20 +0,0 @@
-%{module: C3.Facts.Dump,
- version: 1}
-add {List, :is_a, :module}
-add {List, :symbol, List.cast}
-add {List, :symbol, List.map}
-add {List, :symbol, List.reverse}
-replace {List.cast, :cfn, cfn :list "list_cast" (:tag, :&result)}
-replace {List.map, :fn, fn {
- ([], _) {
- []
- }
- ([a | b], f) {
- [f(a) | List.map(b, f)]
- }
-}}
-replace {List.reverse, :fn, fn {
- (x) { List.reverse(x, []) }
- ([], acc) { acc }
- ([a | b], acc) { List.reverse(b, [a | acc]) }
-}}
diff --git a/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo.app/Contents/lib/c3/0.1/map.facts b/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo.app/Contents/lib/c3/0.1/map.facts
deleted file mode 100644
index de43112..0000000
--- a/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo.app/Contents/lib/c3/0.1/map.facts
+++ /dev/null
@@ -1,11 +0,0 @@
-%{module: C3.Facts.Dump,
- version: 1}
-add {Map, :is_a, :module}
-add {Map, :symbol, Map.cast}
-add {Map, :symbol, Map.map}
-add {Map, :symbol, Map.to_list}
-replace {Map.cast, :cfn, cfn Map "map_cast" (Tag, Result)}
-replace {Map.map, :cfn, cfn List "map_map" (Map, Fn, Result)}
-replace {Map.to_list, :fn, fn (%{} = map) {
- Map.map(map, fn (k, v) { {k, v} })
-}}
diff --git a/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo.app/Contents/lib/c3/0.1/s16.facts b/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo.app/Contents/lib/c3/0.1/s16.facts
deleted file mode 100644
index 2a202d1..0000000
--- a/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo.app/Contents/lib/c3/0.1/s16.facts
+++ /dev/null
@@ -1,5 +0,0 @@
-%{module: C3.Facts.Dump,
- version: 1}
-replace {S16, :is_a, :module}
-replace {S16, :symbol, S16.cast}
-replace {S16.cast, :cfn, cfn S16 "s16_cast" (Tag, Result)}
diff --git a/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo.app/Contents/lib/c3/0.1/s32.facts b/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo.app/Contents/lib/c3/0.1/s32.facts
deleted file mode 100644
index fcbce6e..0000000
--- a/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo.app/Contents/lib/c3/0.1/s32.facts
+++ /dev/null
@@ -1,5 +0,0 @@
-%{module: C3.Facts.Dump,
- version: 1}
-replace {S32, :is_a, :module}
-replace {S32, :symbol, S32.cast}
-replace {S32.cast, :cfn, cfn S32 "s32_cast" (Tag, Result)}
diff --git a/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo.app/Contents/lib/c3/0.1/s64.facts b/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo.app/Contents/lib/c3/0.1/s64.facts
deleted file mode 100644
index 0e39a05..0000000
--- a/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo.app/Contents/lib/c3/0.1/s64.facts
+++ /dev/null
@@ -1,5 +0,0 @@
-%{module: C3.Facts.Dump,
- version: 1}
-replace {S64, :is_a, :module}
-replace {S64, :symbol, S64.cast}
-replace {S64.cast, :cfn, cfn S64 "s64_cast" (Tag, Result)}
diff --git a/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo.app/Contents/lib/c3/0.1/s8.facts b/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo.app/Contents/lib/c3/0.1/s8.facts
deleted file mode 100644
index 746d7ff..0000000
--- a/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo.app/Contents/lib/c3/0.1/s8.facts
+++ /dev/null
@@ -1,5 +0,0 @@
-%{module: C3.Facts.Dump,
- version: 1}
-replace {S8, :is_a, :module}
-replace {S8, :symbol, S8.cast}
-replace {S8.cast, :cfn, cfn S8 "s8_cast" (Tag, Result)}
diff --git a/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo.app/Contents/lib/c3/0.1/sw.facts b/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo.app/Contents/lib/c3/0.1/sw.facts
deleted file mode 100644
index f9ec974..0000000
--- a/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo.app/Contents/lib/c3/0.1/sw.facts
+++ /dev/null
@@ -1,5 +0,0 @@
-%{module: C3.Facts.Dump,
- version: 1}
-replace {Sw, :is_a, :module}
-replace {Sw, :symbol, Sw.cast}
-replace {Sw.cast, :cfn, cfn Sw "sw_cast" (Tag, Result)}
diff --git a/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo.app/Contents/lib/c3/0.1/u16.facts b/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo.app/Contents/lib/c3/0.1/u16.facts
deleted file mode 100644
index ee7d50c..0000000
--- a/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo.app/Contents/lib/c3/0.1/u16.facts
+++ /dev/null
@@ -1,5 +0,0 @@
-%{module: C3.Facts.Dump,
- version: 1}
-replace {U16, :is_a, :module}
-replace {U16, :symbol, U16.cast}
-replace {U16.cast, :cfn, cfn U16 "u16_cast" (Tag, Result)}
diff --git a/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo.app/Contents/lib/c3/0.1/u32.facts b/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo.app/Contents/lib/c3/0.1/u32.facts
deleted file mode 100644
index 29e6146..0000000
--- a/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo.app/Contents/lib/c3/0.1/u32.facts
+++ /dev/null
@@ -1,5 +0,0 @@
-%{module: C3.Facts.Dump,
- version: 1}
-replace {U32, :is_a, :module}
-replace {U32, :symbol, U32.cast}
-replace {U32.cast, :cfn, cfn U32 "u32_cast" (Tag, Result)}
diff --git a/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo.app/Contents/lib/c3/0.1/u64.facts b/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo.app/Contents/lib/c3/0.1/u64.facts
deleted file mode 100644
index 7cea2fe..0000000
--- a/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo.app/Contents/lib/c3/0.1/u64.facts
+++ /dev/null
@@ -1,5 +0,0 @@
-%{module: C3.Facts.Dump,
- version: 1}
-replace {U64, :is_a, :module}
-replace {U64, :symbol, U64.cast}
-replace {U64.cast, :cfn, cfn U64 "u64_cast" (Tag, Result)}
diff --git a/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo.app/Contents/lib/c3/0.1/u8.facts b/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo.app/Contents/lib/c3/0.1/u8.facts
deleted file mode 100644
index 39e73d0..0000000
--- a/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo.app/Contents/lib/c3/0.1/u8.facts
+++ /dev/null
@@ -1,5 +0,0 @@
-%{module: C3.Facts.Dump,
- version: 1}
-replace {U8, :is_a, :module}
-replace {U8, :symbol, U8.cast}
-replace {U8.cast, :cfn, cfn U8 "u8_cast" (Tag, Result)}
diff --git a/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo.app/Contents/lib/c3/0.1/uw.facts b/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo.app/Contents/lib/c3/0.1/uw.facts
deleted file mode 100644
index c4a25a5..0000000
--- a/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo.app/Contents/lib/c3/0.1/uw.facts
+++ /dev/null
@@ -1,5 +0,0 @@
-%{module: C3.Facts.Dump,
- version: 1}
-replace {Uw, :is_a, :module}
-replace {Uw, :symbol, Uw.cast}
-replace {Uw.cast, :cfn, cfn Uw "uw_cast" (Tag, Result)}
diff --git a/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo_debug.app/Contents/lib/c3/0.1/array.facts b/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo_debug.app/Contents/lib/c3/0.1/array.facts
deleted file mode 100644
index 4bcb97c..0000000
--- a/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo_debug.app/Contents/lib/c3/0.1/array.facts
+++ /dev/null
@@ -1,5 +0,0 @@
-%{module: C3.Facts.Dump,
- version: 1}
-add {Array, :is_a, :module}
-add {Array, :symbol, Array.data}
-replace {Array.data, :cfn, cfn :tag "array_data_tag" (:tag, :tag, :&result)}
diff --git a/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo_debug.app/Contents/lib/c3/0.1/c3.facts b/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo_debug.app/Contents/lib/c3/0.1/c3.facts
deleted file mode 100644
index 0bdbba9..0000000
--- a/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo_debug.app/Contents/lib/c3/0.1/c3.facts
+++ /dev/null
@@ -1,188 +0,0 @@
-%{module: C3.Facts.Dump,
- version: 1}
-replace {C3, :is_a, :module}
-replace {C3, :operator, C3.operator00}
-replace {C3.operator00, :is_a, :operator}
-replace {C3.operator00, :symbol, :"()"}
-replace {C3.operator00, :arity, 1}
-replace {C3.operator00, :cfn, cfn Tag "tag_paren" (Tag, Result)}
-replace {C3.operator00, :operator_precedence, 13}
-replace {C3.operator00, :operator_associativity, :left}
-add {C3, :operator, C3.operator01}
-replace {C3.operator01, :is_a, :operator}
-replace {C3.operator01, :symbol, :"[]"}
-replace {C3.operator01, :arity, 2}
-replace {C3.operator01, :cfn, cfn Tag "tag_brackets" (Tag, Tag, Result)}
-replace {C3.operator01, :operator_precedence, 13}
-replace {C3.operator01, :operator_associativity, :left}
-add {C3, :operator, C3.operator02}
-replace {C3.operator02, :is_a, :operator}
-replace {C3.operator02, :symbol, :!}
-replace {C3.operator02, :arity, 1}
-replace {C3.operator02, :cfn, cfn Bool "tag_not" (Tag, Result)}
-replace {C3.operator02, :operator_precedence, 12}
-replace {C3.operator02, :operator_associativity, :right}
-add {C3, :operator, C3.operator03}
-replace {C3.operator03, :is_a, :operator}
-replace {C3.operator03, :symbol, :~}
-replace {C3.operator03, :arity, 1}
-replace {C3.operator03, :cfn, cfn Tag "tag_bnot" (Tag, Result)}
-replace {C3.operator03, :operator_precedence, 12}
-replace {C3.operator03, :operator_associativity, :right}
-add {C3, :operator, C3.operator04}
-replace {C3.operator04, :is_a, :operator}
-replace {C3.operator04, :symbol, :-}
-replace {C3.operator04, :arity, 1}
-replace {C3.operator04, :cfn, cfn Tag "tag_neg" (Tag, Result)}
-replace {C3.operator04, :operator_precedence, 12}
-replace {C3.operator04, :operator_associativity, :right}
-add {C3, :operator, C3.operator05}
-replace {C3.operator05, :is_a, :operator}
-replace {C3.operator05, :symbol, :*}
-replace {C3.operator05, :arity, 2}
-replace {C3.operator05, :cfn, cfn Tag "tag_mul" (Tag, Tag, Result)}
-replace {C3.operator05, :operator_precedence, 11}
-replace {C3.operator05, :operator_associativity, :left}
-add {C3, :operator, C3.operator06}
-replace {C3.operator06, :is_a, :operator}
-replace {C3.operator06, :symbol, :/}
-replace {C3.operator06, :arity, 2}
-replace {C3.operator06, :cfn, cfn Tag "tag_div" (Tag, Tag, Result)}
-replace {C3.operator06, :operator_precedence, 11}
-replace {C3.operator06, :operator_associativity, :left}
-add {C3, :operator, C3.operator07}
-replace {C3.operator07, :is_a, :operator}
-replace {C3.operator07, :symbol, :mod}
-replace {C3.operator07, :arity, 2}
-replace {C3.operator07, :cfn, cfn Tag "tag_mod" (Tag, Tag, Result)}
-replace {C3.operator07, :operator_precedence, 11}
-replace {C3.operator07, :operator_associativity, :left}
-add {C3, :operator, C3.operator08}
-replace {C3.operator08, :is_a, :operator}
-replace {C3.operator08, :symbol, :+}
-replace {C3.operator08, :arity, 2}
-replace {C3.operator08, :cfn, cfn Tag "tag_add" (Tag, Tag, Result)}
-replace {C3.operator08, :operator_precedence, 10}
-replace {C3.operator08, :operator_associativity, :left}
-add {C3, :operator, C3.operator09}
-replace {C3.operator09, :is_a, :operator}
-replace {C3.operator09, :symbol, :-}
-replace {C3.operator09, :arity, 2}
-replace {C3.operator09, :cfn, cfn Tag "tag_sub" (Tag, Tag, Result)}
-replace {C3.operator09, :operator_precedence, 10}
-replace {C3.operator09, :operator_associativity, :left}
-add {C3, :operator, C3.operator10}
-replace {C3.operator10, :is_a, :operator}
-replace {C3.operator10, :symbol, :<<}
-replace {C3.operator10, :arity, 2}
-replace {C3.operator10, :cfn, cfn Tag "tag_shift_left" (Tag, Tag, Result)}
-replace {C3.operator10, :operator_precedence, 9}
-replace {C3.operator10, :operator_associativity, :left}
-add {C3, :operator, C3.operator11}
-replace {C3.operator11, :is_a, :operator}
-replace {C3.operator11, :symbol, :>>}
-replace {C3.operator11, :arity, 2}
-replace {C3.operator11, :cfn, cfn Tag "tag_shift_right" (Tag, Tag, Result)}
-replace {C3.operator11, :operator_precedence, 9}
-replace {C3.operator11, :operator_associativity, :left}
-add {C3, :operator, C3.operator12}
-replace {C3.operator12, :is_a, :operator}
-replace {C3.operator12, :symbol, :<}
-replace {C3.operator12, :arity, 2}
-replace {C3.operator12, :cfn, cfn Bool "tag_lt" (Tag, Tag, Result)}
-replace {C3.operator12, :operator_precedence, 8}
-replace {C3.operator12, :operator_associativity, :left}
-add {C3, :operator, C3.operator13}
-replace {C3.operator13, :symbol, :<=}
-replace {C3.operator13, :is_a, :operator}
-replace {C3.operator13, :arity, 2}
-replace {C3.operator13, :cfn, cfn Bool "tag_lte" (Tag, Tag, Result)}
-replace {C3.operator13, :operator_precedence, 8}
-replace {C3.operator13, :operator_associativity, :left}
-add {C3, :operator, C3.operator14}
-replace {C3.operator14, :symbol, :>}
-replace {C3.operator14, :is_a, :operator}
-replace {C3.operator14, :arity, 2}
-replace {C3.operator14, :cfn, cfn Bool "tag_gt" (Tag, Tag, Result)}
-replace {C3.operator14, :operator_precedence, 8}
-replace {C3.operator14, :operator_associativity, :left}
-add {C3, :operator, C3.operator15}
-replace {C3.operator15, :symbol, :>=}
-replace {C3.operator15, :is_a, :operator}
-replace {C3.operator15, :arity, 2}
-replace {C3.operator15, :cfn, cfn Bool "tag_gte" (Tag, Tag, Result)}
-replace {C3.operator15, :operator_precedence, 8}
-replace {C3.operator15, :operator_associativity, :left}
-add {C3, :operator, C3.operator16}
-replace {C3.operator16, :is_a, :operator}
-replace {C3.operator16, :symbol, :==}
-replace {C3.operator16, :arity, 2}
-replace {C3.operator16, :cfn, cfn Bool "tag_eq" (Tag, Tag, Result)}
-replace {C3.operator16, :operator_precedence, 7}
-replace {C3.operator16, :operator_associativity, :left}
-add {C3, :operator, C3.operator17}
-replace {C3.operator17, :is_a, :operator}
-replace {C3.operator17, :symbol, :!=}
-replace {C3.operator17, :arity, 2}
-replace {C3.operator17, :cfn, cfn Bool "tag_not_eq" (Tag, Tag, Result)}
-replace {C3.operator17, :operator_precedence, 7}
-replace {C3.operator17, :operator_associativity, :left}
-add {C3, :operator, C3.operator18}
-replace {C3.operator18, :is_a, :operator}
-replace {C3.operator18, :symbol, :&}
-replace {C3.operator18, :arity, 2}
-replace {C3.operator18, :cfn, cfn Tag "tag_band" (Tag, Tag, Result)}
-replace {C3.operator18, :operator_precedence, 6}
-replace {C3.operator18, :operator_associativity, :left}
-add {C3, :operator, C3.operator19}
-replace {C3.operator19, :is_a, :operator}
-replace {C3.operator19, :symbol, :^}
-replace {C3.operator19, :arity, 2}
-replace {C3.operator19, :cfn, cfn Tag "tag_bxor" (Tag, Tag, Result)}
-replace {C3.operator19, :operator_precedence, 5}
-replace {C3.operator19, :operator_associativity, :left}
-add {C3, :operator, C3.operator20}
-replace {C3.operator20, :is_a, :operator}
-replace {C3.operator20, :symbol, :bor}
-replace {C3.operator20, :arity, 2}
-replace {C3.operator20, :cfn, cfn Tag "tag_bor" (Tag, Tag, Result)}
-replace {C3.operator20, :operator_precedence, 4}
-replace {C3.operator20, :operator_associativity, :left}
-add {C3, :operator, C3.operator21}
-replace {C3.operator21, :is_a, :operator}
-replace {C3.operator21, :symbol, :&&}
-replace {C3.operator21, :arity, 2}
-replace {C3.operator21, :cfn, cfn Bool "tag_and" (Tag, Tag, Result)}
-replace {C3.operator21, :operator_precedence, 3}
-replace {C3.operator21, :operator_associativity, :left}
-add {C3, :operator, C3.operator22}
-replace {C3.operator22, :is_a, :operator}
-replace {C3.operator22, :symbol, :||}
-replace {C3.operator22, :arity, 2}
-replace {C3.operator22, :cfn, cfn Bool "tag_or" (Tag, Tag, Result)}
-replace {C3.operator22, :operator_precedence, 2}
-replace {C3.operator22, :operator_associativity, :left}
-add {C3, :operator, C3.operator23}
-replace {C3.operator23, :is_a, :operator}
-add {C3.operator23, :is_a, :special_operator}
-replace {C3.operator23, :symbol, :=}
-replace {C3.operator23, :arity, 2}
-replace {C3.operator23, :cfn, cfn Tag "tag_equal" (Tag, Tag, Result)}
-replace {C3.operator23, :operator_precedence, 1}
-replace {C3.operator23, :operator_associativity, :right}
-replace {C3.break, :cfn, cfn Void "c3_break" ()}
-replace {C3, :symbol, C3.first}
-replace {C3.first, :fn, fn {
- ([a | _b]) { a }
- ({a, _b}) { a }
- ({a, _b, _c}) { a }
- ({a, _b, _c, _d}) { a }
-}}
-add {C3, :symbol, C3.license}
-replace {C3.license, :cfn, cfn Void "c3_license" ()}
-add {C3, :symbol, C3.type}
-replace {C3.type, :cfn, cfn Sym "tag_type" (Tag, Result)}
-add {C3, :symbol, C3.fib}
-replace {C3.fib, :fn, fn { (0) { 1 }
- (1) { 1 }
- (x) { fib(x - 1) + fib(x - 2) } }}
diff --git a/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo_debug.app/Contents/lib/c3/0.1/integer.facts b/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo_debug.app/Contents/lib/c3/0.1/integer.facts
deleted file mode 100644
index ff8d8e7..0000000
--- a/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo_debug.app/Contents/lib/c3/0.1/integer.facts
+++ /dev/null
@@ -1,5 +0,0 @@
-%{module: C3.Facts.Dump,
- version: 1}
-replace {Integer, :is_a, :module}
-replace {Integer, :symbol, Integer.cast}
-replace {Integer.cast, :cfn, cfn Integer "integer_cast" (Tag, Result)}
diff --git a/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo_debug.app/Contents/lib/c3/0.1/list.facts b/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo_debug.app/Contents/lib/c3/0.1/list.facts
deleted file mode 100644
index ea05f14..0000000
--- a/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo_debug.app/Contents/lib/c3/0.1/list.facts
+++ /dev/null
@@ -1,20 +0,0 @@
-%{module: C3.Facts.Dump,
- version: 1}
-add {List, :is_a, :module}
-add {List, :symbol, List.cast}
-add {List, :symbol, List.map}
-add {List, :symbol, List.reverse}
-replace {List.cast, :cfn, cfn :list "list_cast" (:tag, :&result)}
-replace {List.map, :fn, fn {
- ([], _) {
- []
- }
- ([a | b], f) {
- [f(a) | List.map(b, f)]
- }
-}}
-replace {List.reverse, :fn, fn {
- (x) { List.reverse(x, []) }
- ([], acc) { acc }
- ([a | b], acc) { List.reverse(b, [a | acc]) }
-}}
diff --git a/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo_debug.app/Contents/lib/c3/0.1/map.facts b/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo_debug.app/Contents/lib/c3/0.1/map.facts
deleted file mode 100644
index de43112..0000000
--- a/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo_debug.app/Contents/lib/c3/0.1/map.facts
+++ /dev/null
@@ -1,11 +0,0 @@
-%{module: C3.Facts.Dump,
- version: 1}
-add {Map, :is_a, :module}
-add {Map, :symbol, Map.cast}
-add {Map, :symbol, Map.map}
-add {Map, :symbol, Map.to_list}
-replace {Map.cast, :cfn, cfn Map "map_cast" (Tag, Result)}
-replace {Map.map, :cfn, cfn List "map_map" (Map, Fn, Result)}
-replace {Map.to_list, :fn, fn (%{} = map) {
- Map.map(map, fn (k, v) { {k, v} })
-}}
diff --git a/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo_debug.app/Contents/lib/c3/0.1/s16.facts b/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo_debug.app/Contents/lib/c3/0.1/s16.facts
deleted file mode 100644
index 2a202d1..0000000
--- a/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo_debug.app/Contents/lib/c3/0.1/s16.facts
+++ /dev/null
@@ -1,5 +0,0 @@
-%{module: C3.Facts.Dump,
- version: 1}
-replace {S16, :is_a, :module}
-replace {S16, :symbol, S16.cast}
-replace {S16.cast, :cfn, cfn S16 "s16_cast" (Tag, Result)}
diff --git a/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo_debug.app/Contents/lib/c3/0.1/s32.facts b/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo_debug.app/Contents/lib/c3/0.1/s32.facts
deleted file mode 100644
index fcbce6e..0000000
--- a/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo_debug.app/Contents/lib/c3/0.1/s32.facts
+++ /dev/null
@@ -1,5 +0,0 @@
-%{module: C3.Facts.Dump,
- version: 1}
-replace {S32, :is_a, :module}
-replace {S32, :symbol, S32.cast}
-replace {S32.cast, :cfn, cfn S32 "s32_cast" (Tag, Result)}
diff --git a/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo_debug.app/Contents/lib/c3/0.1/s64.facts b/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo_debug.app/Contents/lib/c3/0.1/s64.facts
deleted file mode 100644
index 0e39a05..0000000
--- a/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo_debug.app/Contents/lib/c3/0.1/s64.facts
+++ /dev/null
@@ -1,5 +0,0 @@
-%{module: C3.Facts.Dump,
- version: 1}
-replace {S64, :is_a, :module}
-replace {S64, :symbol, S64.cast}
-replace {S64.cast, :cfn, cfn S64 "s64_cast" (Tag, Result)}
diff --git a/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo_debug.app/Contents/lib/c3/0.1/s8.facts b/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo_debug.app/Contents/lib/c3/0.1/s8.facts
deleted file mode 100644
index 746d7ff..0000000
--- a/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo_debug.app/Contents/lib/c3/0.1/s8.facts
+++ /dev/null
@@ -1,5 +0,0 @@
-%{module: C3.Facts.Dump,
- version: 1}
-replace {S8, :is_a, :module}
-replace {S8, :symbol, S8.cast}
-replace {S8.cast, :cfn, cfn S8 "s8_cast" (Tag, Result)}
diff --git a/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo_debug.app/Contents/lib/c3/0.1/sw.facts b/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo_debug.app/Contents/lib/c3/0.1/sw.facts
deleted file mode 100644
index f9ec974..0000000
--- a/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo_debug.app/Contents/lib/c3/0.1/sw.facts
+++ /dev/null
@@ -1,5 +0,0 @@
-%{module: C3.Facts.Dump,
- version: 1}
-replace {Sw, :is_a, :module}
-replace {Sw, :symbol, Sw.cast}
-replace {Sw.cast, :cfn, cfn Sw "sw_cast" (Tag, Result)}
diff --git a/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo_debug.app/Contents/lib/c3/0.1/u16.facts b/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo_debug.app/Contents/lib/c3/0.1/u16.facts
deleted file mode 100644
index ee7d50c..0000000
--- a/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo_debug.app/Contents/lib/c3/0.1/u16.facts
+++ /dev/null
@@ -1,5 +0,0 @@
-%{module: C3.Facts.Dump,
- version: 1}
-replace {U16, :is_a, :module}
-replace {U16, :symbol, U16.cast}
-replace {U16.cast, :cfn, cfn U16 "u16_cast" (Tag, Result)}
diff --git a/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo_debug.app/Contents/lib/c3/0.1/u32.facts b/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo_debug.app/Contents/lib/c3/0.1/u32.facts
deleted file mode 100644
index 29e6146..0000000
--- a/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo_debug.app/Contents/lib/c3/0.1/u32.facts
+++ /dev/null
@@ -1,5 +0,0 @@
-%{module: C3.Facts.Dump,
- version: 1}
-replace {U32, :is_a, :module}
-replace {U32, :symbol, U32.cast}
-replace {U32.cast, :cfn, cfn U32 "u32_cast" (Tag, Result)}
diff --git a/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo_debug.app/Contents/lib/c3/0.1/u64.facts b/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo_debug.app/Contents/lib/c3/0.1/u64.facts
deleted file mode 100644
index 7cea2fe..0000000
--- a/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo_debug.app/Contents/lib/c3/0.1/u64.facts
+++ /dev/null
@@ -1,5 +0,0 @@
-%{module: C3.Facts.Dump,
- version: 1}
-replace {U64, :is_a, :module}
-replace {U64, :symbol, U64.cast}
-replace {U64.cast, :cfn, cfn U64 "u64_cast" (Tag, Result)}
diff --git a/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo_debug.app/Contents/lib/c3/0.1/u8.facts b/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo_debug.app/Contents/lib/c3/0.1/u8.facts
deleted file mode 100644
index 39e73d0..0000000
--- a/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo_debug.app/Contents/lib/c3/0.1/u8.facts
+++ /dev/null
@@ -1,5 +0,0 @@
-%{module: C3.Facts.Dump,
- version: 1}
-replace {U8, :is_a, :module}
-replace {U8, :symbol, U8.cast}
-replace {U8.cast, :cfn, cfn U8 "u8_cast" (Tag, Result)}
diff --git a/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo_debug.app/Contents/lib/c3/0.1/uw.facts b/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo_debug.app/Contents/lib/c3/0.1/uw.facts
deleted file mode 100644
index c4a25a5..0000000
--- a/libc3/window/cairo/quartz/demo/c3_window_cairo_quartz_demo_debug.app/Contents/lib/c3/0.1/uw.facts
+++ /dev/null
@@ -1,5 +0,0 @@
-%{module: C3.Facts.Dump,
- version: 1}
-replace {Uw, :is_a, :module}
-replace {Uw, :symbol, Uw.cast}
-replace {Uw.cast, :cfn, cfn Uw "uw_cast" (Tag, Result)}
diff --git a/libc3/window/cairo/quartz/demo/window_cairo_quartz_demo.c b/libc3/window/cairo/quartz/demo/window_cairo_quartz_demo.c
index 7635a23..00b6fb3 100644
--- a/libc3/window/cairo/quartz/demo/window_cairo_quartz_demo.c
+++ b/libc3/window/cairo/quartz/demo/window_cairo_quartz_demo.c
@@ -33,6 +33,7 @@ int main (int argc, s8 **argv)
window.load = window_cairo_demo_load;
window.render = window_cairo_demo_render;
window.resize = window_cairo_demo_resize;
+ window.unload = window_cairo_demo_unload;
if (! window_cairo_quartz_run(&window))
r = g_c3_exit_code;
window_cairo_clean(&window);
diff --git a/libc3/window/sdl2/demo/earth.c b/libc3/window/sdl2/demo/earth.c
index b7e02a0..0465dc9 100644
--- a/libc3/window/sdl2/demo/earth.c
+++ b/libc3/window/sdl2/demo/earth.c
@@ -63,20 +63,20 @@ bool earth_render (s_sequence *seq, s_window_sdl2 *window,
assert(window);
(void) context;
if (! seq || seq->tag.type != TAG_MAP ||
- seq->tag.data.map.count < 2) {
+ seq->tag.data.map.count != 3) {
warnx("earth_render: invalid seq->tag");
return false;
}
map = &seq->tag.data.map;
- if (map->value[0].type != TAG_PTR ||
+ if (map->value[0].type != TAG_PTR_FREE ||
map->value[1].type != TAG_F64 ||
- map->value[2].type != TAG_PTR) {
+ map->value[2].type != TAG_STRUCT) {
warnx("earth_render: invalid map");
return false;
}
- camera = map->value[0].data.ptr.p;
+ camera = map->value[0].data.ptr_free.p;
camera_rot_x_speed = &map->value[1].data.f64;
- sphere = map->value[2].data.ptr.p;
+ sphere = map->value[2].data.struct_.data;
gl_camera_set_aspect_ratio(camera, window->w, window->h);
camera->rotation.x += seq->dt * (*camera_rot_x_speed) *
360.0;