summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore7
-rw-r--r--Makefile23
-rw-r--r--common.c48
-rw-r--r--examples/Makefile23
-rw-r--r--examples/algebraic.sin13
-rw-r--r--examples/crosses.int8
-rw-r--r--examples/e.int21
-rw-r--r--examples/either.sin25
-rw-r--r--examples/fib.int12
-rw-r--r--examples/glue.c42
-rw-r--r--examples/list_null.c27
-rw-r--r--examples/maybe.sin22
-rw-r--r--examples/nq/Makefile1
-rw-r--r--examples/nq/gglue.ll41
-rw-r--r--examples/nqueens/list.sin56
-rw-r--r--examples/nqueens/nqueens.sin67
-rw-r--r--examples/power.int18
-rw-r--r--examples/repeat.h70
-rw-r--r--examples/run_func.c75
-rw-r--r--examples/tree.sin16
-rw-r--r--examples/util.sin2
21 files changed, 62 insertions, 555 deletions
diff --git a/.gitignore b/.gitignore
index 2326995..b43bd57 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,8 @@
+# exclude extension-less files
+*
+!/**/
+!*.*
+
*.o
*.bc
@@ -5,6 +10,4 @@ lex.c
parse.c
parse.h
-sinter
-
*.sw*
diff --git a/Makefile b/Makefile
index 896dbcc..e25ffd0 100644
--- a/Makefile
+++ b/Makefile
@@ -3,24 +3,33 @@ CXX = clang++
YACC = bison
LEX = flex
-DEBUG = -ggdb3 -O0 -DGC_DEBUG
+INSTALL = install -c
+
+DEBUG = -ggdb3 -DGC_DEBUG
RELEASE = -O2 -DNDEBUG
-CFLAGS = --std=c99 -Wpedantic -Wall -Wextra -Werror $(DEBUG)
+CFLAGS = --std=c99 -Wpedantic -Wall -Wextra -Werror $(RELEASE)
LFLAGS = -D_POSIX_C_SOURCE=200809L
LLVM_MODULES = core executionengine mcjit interpreter analysis native bitwriter
-CFLAGS += $(shell llvm-config --cflags) -I$(HOME)/usr/include
+CFLAGS += $(shell llvm-config --cflags)
CXXFLAGS += $(shell llvm-config --cppflags)
-LDFLAGS += $(shell llvm-config --ldflags) -L$(HOME)/usr/lib
-LDLIBS += $(shell llvm-config --libs $(LLVM_MODULES) --system-libs) -lgc
+LDFLAGS += $(shell llvm-config --ldflags)
+LDLIBS += $(shell llvm-config --libs $(LLVM_MODULES) --system-libs)
-.PHONY: default all clean test
+.PHONY: default all clean test install uninstall
default: all
-all: sinter common.o
+all: sinter
+
+install: all
+ $(INSTALL) -d $(PREFIX)/bin/
+ $(INSTALL) sinter $(PREFIX)/bin/
+
+uninstall:
+ $(RM) $(PREFIX)/bin/sinter
sinter.o: sinter.h parse.h debug.h error.h scope.h llvm_codegen.h \
graphviz_codegen.h
diff --git a/common.c b/common.c
deleted file mode 100644
index 67acd51..0000000
--- a/common.c
+++ /dev/null
@@ -1,48 +0,0 @@
-#include <stddef.h>
-#include <stdio.h>
-#include <assert.h>
-
-#include <gc.h>
-
-void *inter_main(void);
-
-void *debug_int(void *i) {
- int *p = (int *) i;
- fprintf(stderr, "%d\n", *p);
- return i;
-}
-
-void *debug_func_call(void *f) {
- char *func_id = (char *) f;
- fprintf(stderr, "%s\n", func_id);
- return 0;
-}
-
-void *gc_alloc(int size) {
- void *p = GC_MALLOC(size);
-
- /*
- * To get info about the GC discarding objects, use
- * GC_REGISTER_FINALIZER(p, fn, arg, 0, 0);
- *
- * This runs fn(p, arg) when the object at p is finalised.
- *
- * More info in gc.h of Boehm garbage collector.
- */
-
- return p;
-}
-
-int main() {
-
- /*
- * Initialising the GC is not necessary on all systems but may be required
- * on some. Better safe than sorry! See gc.h for more info.
- */
- GC_INIT();
-
- int *ret = (int *) inter_main();
-
- assert(ret);
- return *ret;
-}
diff --git a/examples/Makefile b/examples/Makefile
deleted file mode 100644
index 3707e79..0000000
--- a/examples/Makefile
+++ /dev/null
@@ -1,23 +0,0 @@
-CC = clang
-CXX = clang++
-SINC = ../sinter
-
-CFLAGS = -g -O0 -Werror -Wpedantic -Wall
-LDFLAGS = -L$(HOME)/usr/lib -g
-LDLIBS = -lgc
-
-LLCFLAGS = $(CFLAGS)
-SINCFLAGS =
-
-TRGT =
-
-include ../common.mak
-
-.PHONY: default all clean
-
-default: all
-
-all: $(TRGT)
-
-clean:
- $(RM) *.ll *.dot *.svg *.o $(TRGT)
diff --git a/examples/algebraic.sin b/examples/algebraic.sin
deleted file mode 100644
index a3d4337..0000000
--- a/examples/algebraic.sin
+++ /dev/null
@@ -1,13 +0,0 @@
-[dec just [x]]
-[dec none []]
-[dec has_value [x]]
-[dec Maybe.>>= [a f]]
-[dec just.val [x]]
-
-[def double [x]
- [just [* x 2]]]
-
-[def inter_main []
- [debug_int
- [just.val
- [Maybe.>>= [just 10] double]]]]
diff --git a/examples/crosses.int b/examples/crosses.int
deleted file mode 100644
index a1d8c99..0000000
--- a/examples/crosses.int
+++ /dev/null
@@ -1,8 +0,0 @@
-[dec loop [c]]
-[dec create_window [c x y w h]]
-[dec init_sdl []]
-
-[def on_click [x y] [debug_int [+ x y]]]
-
-[def inter_main []
- [loop [create_window [init_sdl] 10 10 100 100]]]
diff --git a/examples/e.int b/examples/e.int
deleted file mode 100644
index f49b406..0000000
--- a/examples/e.int
+++ /dev/null
@@ -1,21 +0,0 @@
-[type cons [(INT head) (cons tail)]]
-[def (INT ==) [(INT a) (INT b)] [if [- a b] 0 1]]
-[def (INT hastail) [(INT list)] [if [cons.tail list] 1 0]]
-[def (INT carry_guess) [(INT d) (INT base)] [/ d base]]
-[def (INT remainder) [(INT d) (INT base)] [% d base]]
-[def (INT carry_propagate) [(INT a) (INT b)] [+ 1 1]]
-[def (INT next_carry) [(INT base) (INT ds)]
- [carry_propagate [+ base 1] [cons.tail ds]]]
-[def (INT d_corrected) [(INT base) (INT ds)]
- [+ [cons.head ds] [next_carry base ds]]]
-
-[def (INT carry_propagate) [(INT base) (INT ds)] [
- if [== [carry_guess [cons.head ds] base] [/ [+ [cons.head ds] 9] base]]
- [cons [carry_guess [cons.head ds] base]
- [+ [remainder [cons.head ds] base] [next_carry base [cons.tail ds]]]]
- [cons [/ d_corrected base] [% d_corrected base]]
-]]
-
-[def (INT e) [(INT n)]
- [
-[def (INT inter_main) [] [debug_int [+ 1 1]]]
diff --git a/examples/either.sin b/examples/either.sin
deleted file mode 100644
index e16b7b8..0000000
--- a/examples/either.sin
+++ /dev/null
@@ -1,25 +0,0 @@
-[type left_ [kind val]]
-[type right_ [kind val]]
-
-[def left [val]
- [left_ 0 val]]
-
-[def right [val]
- [right_ 1 val]]
-
-[def left.val [x]
- [left_.val x]]
-
-[def right.val [x]
- [right_.val x]]
-
-[def is_right [x]
- [right_.kind x]]
-
-[def Either.>>= [a f]
- [if [is_right a]
- [f [right.val a]]
- a]]
-
-[def Either.return [x]
- [right x]]
diff --git a/examples/fib.int b/examples/fib.int
deleted file mode 100644
index 11736d0..0000000
--- a/examples/fib.int
+++ /dev/null
@@ -1,12 +0,0 @@
-[dec wowow []]
-[type test [(INT x) (INT y)]]
-[def testest [] [test.y [test 3 10]]]
-[def dec [n] [- n 1]]
-[def inc [n] [+ n 1]]
-[def ttt [x y] [test y x]]
-[def ! [b] [if b 0 1]]
-[def != [x y] [- x y]]
-[def == [x y] [! [!= x y]]]
-[def or [a b] [if a 1 b]]
-[def fib [n] [debug_int [if [or [== n 0] [== n 1]] 1 [+ [fib [- n 1]] [fib [- n 2]]]]]]
-[def inter_main [] [fib [test.y [ttt 10 10]]]]
diff --git a/examples/glue.c b/examples/glue.c
deleted file mode 100644
index 33e44bd..0000000
--- a/examples/glue.c
+++ /dev/null
@@ -1,42 +0,0 @@
-#include <stdio.h>
-
-#include <SDL2/SDL.h>
-
-void *on_click(void *x, void *y);
-
-void *init_sdl() {
- return (void *) SDL_Init(SDL_INIT_VIDEO);
-}
-
-void *create_window(void *init, void *xv, void *yv, void *wv, void *hv) {
- int x = (int) xv, y = (int) yv, w = (int) wv, h = (int) hv;
- int window_flags = SDL_WINDOW_SHOWN | SDL_WINDOW_RESIZABLE;
- SDL_Window *window = SDL_CreateWindow("window", x, y, w, h, window_flags);
- int rend_flags = SDL_RENDERER_ACCELERATED;
- SDL_Renderer *rend = SDL_CreateRenderer(window, -1, rend_flags);
- printf("window created\n");
- return (void *) window;
-}
-
-void *loop(void *window) {
- int running = 1;
- SDL_Event e;
- while (running) {
- while (SDL_PollEvent(&e)) {
- printf("event\n");
- switch (e.type) {
- case SDL_QUIT:
- running = 0;
- break;
- case SDL_MOUSEBUTTONDOWN: {
- SDL_MouseButtonEvent mbe = e.button;
- if (mbe.button == SDL_BUTTON_LEFT) {
- on_click((void *) mbe.x, (void *) mbe.y);
- }
- break;
- }
- }
- }
- }
- return 0;
-}
diff --git a/examples/list_null.c b/examples/list_null.c
deleted file mode 100644
index 85a3d2c..0000000
--- a/examples/list_null.c
+++ /dev/null
@@ -1,27 +0,0 @@
-typedef struct list_t {
- void *content;
- struct list_t *next;
-} list_t;
-
-void *list(void *head, void *tail) {
- list_t *ret = gc_alloc(sizeof (*ret));
- ret->content = head;
- ret->next = (list_t *) tail;
- return ret;
-}
-
-void *nil() {
- return (void *) 0;
-}
-
-void *head(void *list) {
- return list->head;
-}
-
-void *tail(void *list) {
- return list->tail;
-}
-
-void *has_tail(void *list) {
- return list->tail;
-}
diff --git a/examples/maybe.sin b/examples/maybe.sin
deleted file mode 100644
index 91367cd..0000000
--- a/examples/maybe.sin
+++ /dev/null
@@ -1,22 +0,0 @@
-[type just_ [kind val]]
-[type none_ [kind]]
-
-[def just [val]
- [just_ 1 val]]
-
-[def just.val [x]
- [just_.val x]]
-
-[def none []
- [none_ 0]]
-
-[def has_value [x]
- [just_.kind x]]
-
-[def Maybe.>>= [a f]
- [if [has_value a]
- [f [just.val a]]
- a]]
-
-[def Maybe.return [x]
- [just x]]
diff --git a/examples/nq/Makefile b/examples/nq/Makefile
index 1f8a66b..719acc2 100644
--- a/examples/nq/Makefile
+++ b/examples/nq/Makefile
@@ -1,6 +1,5 @@
CC = clang
CXX = clang++
-SINC = ../../sinter
DEBUG = -g -O0
diff --git a/examples/nq/gglue.ll b/examples/nq/gglue.ll
new file mode 100644
index 0000000..f78a603
--- /dev/null
+++ b/examples/nq/gglue.ll
@@ -0,0 +1,41 @@
+target triple = "x86_64-unknown-linux-gnu"
+
+declare fastcc i8* @gen(i8*, i8*)
+
+declare fastcc i8* @length (i8*)
+
+define fastcc i32 @inc(i32) {
+ %res = add i32 1, %0
+ ret i32 %res
+}
+
+define fastcc i32 @"+"(i32, i32) {
+ %res = add i32 %0, %1
+ ret i32 %res
+}
+
+define fastcc i32 @-(i32, i32) {
+ %res = sub i32 %0, %1
+ ret i32 %res
+}
+
+define fastcc i32 @count_solns(i32) {
+ %cast = inttoptr i32 %0 to i8*
+ %solns = call fastcc i8* @gen(i8* %cast, i8* %cast)
+ %n_solns = call fastcc i8* @length(i8* %solns)
+ %res = ptrtoint i8* %n_solns to i32
+ ret i32 %res
+}
+
+define fastcc i32 @_count_solns(i32) {
+ %ext = zext i32 %0 to i128
+ %alloc = alloca i128
+ store i128 %ext, i128* %alloc
+ %box = bitcast i128* %alloc to i8*
+ %solns = call fastcc i8* @gen(i8* %box, i8* %box)
+ %n_solns = call fastcc i8* @length(i8* %solns)
+ %uncast = bitcast i8* %n_solns to i128*
+ %unboxed = load i128, i128* %uncast
+ %res = trunc i128 %unboxed to i32
+ ret i32 %res
+}
diff --git a/examples/nqueens/list.sin b/examples/nqueens/list.sin
deleted file mode 100644
index 9a59945..0000000
--- a/examples/nqueens/list.sin
+++ /dev/null
@@ -1,56 +0,0 @@
-[type cons_ [kind head tail]]
-[type nil_ [kind]]
-
-[def cons [head tail]
- [cons_ 1 head tail]]
-
-[def nil []
- [nil_ 0]]
-
-[def head [xs]
- [cons_.head xs]]
-
-[def tail [xs]
- [cons_.tail xs]]
-
-[def has_tail [xs]
- [nil_.kind xs]]
-
-[def is_nil [x]
- [if [nil_.kind x]
- 0
- 1]]
-
-[def concat [as bs]
- [cons [head as]
- [if [is_nil [tail as]]
- bs
- [concat [tail as] bs]]]]
-
-[def alt_concat [as bs]
- [if [is_nil [tail as]]
- [cons [head as] bs]
- [cons [head as] [concat [tail as] bs]]]]
-
-[def flatten_once [xs]
- [concat [head xs] [flatten_once [tail xs]]]]
-
-[def List.>>= [ma f]
- [flatten_once [map ma f]]]
-
-[def List.return [a]
- [cons a [nil]]]
-
-[def prepend [x xs]
- [cons x xs]]
-
-[def append [xs x]
- [if [is_nil xs]
- [cons [debug_int x] [nil]]
- [cons [head xs] [append [tail xs] x]]]]
-
-[def map [xs f]
- [if [is_nil xs]
- xs
- [cons [f [head xs]]
- [map [tail xs] f]]]]
diff --git a/examples/nqueens/nqueens.sin b/examples/nqueens/nqueens.sin
deleted file mode 100644
index 4779586..0000000
--- a/examples/nqueens/nqueens.sin
+++ /dev/null
@@ -1,67 +0,0 @@
-[dec cons [head tail]]
-[dec nil []]
-[dec head [xs]]
-[dec tail [xs]]
-[dec length [xs]]
-
-[type pair [(INT left) (INT right)]]
-
-[def nsoln [nq]
- [length [gen nq nq]]]
-
-[def inter_main []
- [debug_int [nsoln 4]]]
-
-[def (INT ==) [(INT a) (INT b)]
- [if [- a b] 1 0]]
-
-[def (INT not) [(INT x)]
- [if x 0 1]]
-
-[def (INT !=) [(INT a) (INT b)]
- [not [== a b]]]
-
-[def (INT and) [(INT a) (INT b)]
- [if a [if b 1 0] 0]]
-
-[def (INT length) [(INT xs)]
- [debug_int [if xs [+ 1 [length [cons.tail xs]]] 0]]]
-
-[def (INT count) [(INT from) (INT to)]
- [if [== from to] to [cons from [count [+ from 1] to]]]]
-
-[def (INT concat) [(INT as) (INT bs)]
- [if [cons.tail as]
- [cons [cons.head as] [concat [cons.tail as] bs]]
- [cons [cons.head as] bs]]]
-
-[def (INT combo2) [(INT a) (INT bs)]
- [if bs
- [cons [pair a [cons.head bs]] [combo2 a [cons.tail bs]]]
- 0]]
-
-[def (INT combo) [(INT as) (INT bs)]
- [if as
- [concat [combo2 [cons.head as] bs] [combo [cons.tail as] bs]]
- 0]]
-
-[def (INT safe) [(INT x) (INT d) (INT qs)]
- [if qs
- [and [and [!= x [cons.head qs]]
- [!= x [+ [cons.head qs] d]]]
- [and [!= x [- [cons.head qs] d]]
- [safe x [+ d 1] [cons.tail qs]]]]
- 1]]
-
-[def (INT safe_filter) [(INT xs)]
- [if [safe [pair.left xs] 1 [pair.right xs]]
- [cons [cons.head xs] [safe_filter [cons.tail xs]]]
- [safe_filter [cons.tail xs]]]]
-
-[def (INT gen) [(INT n) (INT nq)]
- [if n [safe_filter [combo [gen [- n 1] nq] [count 1 nq]]] 0]]
-
-[def (INT nsoln) [(INT nq)]
- [length [gen nq nq]]]
-
-[def (INT inter_main) [] [debug_int [nsoln 4]]]
diff --git a/examples/power.int b/examples/power.int
deleted file mode 100644
index 119166d..0000000
--- a/examples/power.int
+++ /dev/null
@@ -1,18 +0,0 @@
-[def -- [x]
- [- x 1]]
-
-[def +++ [x y]
- [+ x y]]
-
-[def *** [x y]
- [if x
- [+++ y [*** [-- x] y]]
- 0]]
-
-[def ^^^ [b p]
- [if p
- [*** b [^^^ b [-- p]]]
- 1]]
-
-[def inter_main []
- [debug_int [^^^ 3 6]]]
diff --git a/examples/repeat.h b/examples/repeat.h
deleted file mode 100644
index 8564abf..0000000
--- a/examples/repeat.h
+++ /dev/null
@@ -1,70 +0,0 @@
-#ifndef REPEAT_H
-#define REPEAT_H
-
-#define repeat_1(x) x
-#define repeat_2(x) x, repeat_1(x)
-#define repeat_3(x) x, repeat_2(x)
-#define repeat_4(x) x, repeat_3(x)
-#define repeat_5(x) x, repeat_4(x)
-#define repeat_6(x) x, repeat_5(x)
-#define repeat_7(x) x, repeat_6(x)
-#define repeat_8(x) x, repeat_7(x)
-#define repeat_9(x) x, repeat_8(x)
-#define repeat_10(x) x, repeat_9(x)
-#define repeat_11(x) x, repeat_10(x)
-#define repeat_12(x) x, repeat_11(x)
-#define repeat_13(x) x, repeat_12(x)
-#define repeat_14(x) x, repeat_13(x)
-#define repeat_15(x) x, repeat_14(x)
-#define repeat_16(x) x, repeat_15(x)
-#define repeat_17(x) x, repeat_16(x)
-#define repeat_18(x) x, repeat_17(x)
-#define repeat_19(x) x, repeat_18(x)
-#define repeat_20(x) x, repeat_19(x)
-#define repeat_21(x) x, repeat_20(x)
-#define repeat_22(x) x, repeat_21(x)
-#define repeat_23(x) x, repeat_22(x)
-#define repeat_24(x) x, repeat_23(x)
-#define repeat_25(x) x, repeat_24(x)
-#define repeat_26(x) x, repeat_25(x)
-#define repeat_27(x) x, repeat_26(x)
-#define repeat_28(x) x, repeat_27(x)
-#define repeat_29(x) x, repeat_28(x)
-#define repeat_30(x) x, repeat_29(x)
-#define repeat_31(x) x, repeat_30(x)
-#define repeat_32(x) x, repeat_31(x)
-
-#define repeat_n_1(x) concat(x, 1)
-#define repeat_n_2(x) repeat_n_1(x), concat(x, 2)
-#define repeat_n_3(x) repeat_n_2(x), concat(x, 3)
-#define repeat_n_4(x) repeat_n_3(x), concat(x, 4)
-#define repeat_n_5(x) repeat_n_4(x), concat(x, 5)
-#define repeat_n_6(x) repeat_n_5(x), concat(x, 6)
-#define repeat_n_7(x) repeat_n_6(x), concat(x, 7)
-#define repeat_n_8(x) repeat_n_7(x), concat(x, 8)
-#define repeat_n_9(x) repeat_n_8(x), concat(x, 9)
-#define repeat_n_10(x) repeat_n_9(x), concat(x, 10)
-#define repeat_n_11(x) repeat_n_10(x), concat(x, 11)
-#define repeat_n_12(x) repeat_n_11(x), concat(x, 12)
-#define repeat_n_13(x) repeat_n_12(x), concat(x, 13)
-#define repeat_n_14(x) repeat_n_13(x), concat(x, 14)
-#define repeat_n_15(x) repeat_n_14(x), concat(x, 15)
-#define repeat_n_16(x) repeat_n_15(x), concat(x, 16)
-#define repeat_n_17(x) repeat_n_16(x), concat(x, 17)
-#define repeat_n_18(x) repeat_n_17(x), concat(x, 18)
-#define repeat_n_19(x) repeat_n_18(x), concat(x, 19)
-#define repeat_n_20(x) repeat_n_19(x), concat(x, 20)
-#define repeat_n_21(x) repeat_n_20(x), concat(x, 21)
-#define repeat_n_22(x) repeat_n_21(x), concat(x, 22)
-#define repeat_n_23(x) repeat_n_22(x), concat(x, 23)
-#define repeat_n_24(x) repeat_n_23(x), concat(x, 24)
-#define repeat_n_25(x) repeat_n_24(x), concat(x, 25)
-#define repeat_n_26(x) repeat_n_25(x), concat(x, 26)
-#define repeat_n_27(x) repeat_n_26(x), concat(x, 27)
-#define repeat_n_28(x) repeat_n_27(x), concat(x, 28)
-#define repeat_n_29(x) repeat_n_28(x), concat(x, 29)
-#define repeat_n_30(x) repeat_n_29(x), concat(x, 30)
-#define repeat_n_31(x) repeat_n_30(x), concat(x, 31)
-#define repeat_n_32(x) repeat_n_31(x), concat(x, 32)
-
-#endif /* REPEAT_H */
diff --git a/examples/run_func.c b/examples/run_func.c
deleted file mode 100644
index e4ca8fb..0000000
--- a/examples/run_func.c
+++ /dev/null
@@ -1,75 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-
-#include "repeat.h"
-
-typedef struct list {
- void *kind;
- void *contents;
- struct list *next;
-} list;
-
-/* FIXME: double fprintf is ugly */
-#define error(v, ...) do { \
- fprintf(stderr, __VA_ARGS__); \
- fprintf(stderr, "\n"); \
- exit(v); \
-} while (0)
-
-#define _concat(a, b) a ## b
-#define concat(a, b) _concat(a, b)
-
-#define assign_arg(n) \
- concat(arg_, n) = l->contents; \
- fprintf(stderr, "%p: %i\n", concat(arg_, n), *((int *) concat(arg_, n))); \
- l = l->next
-
-#define cast_apply_f(n) return ((void *(*)(concat(repeat_, n)(void *))) f)\
-(concat(repeat_n_, n)(arg_))
-
-#define new_case(n) \
- assign_arg(n); \
- if (arity == n) cast_apply_f(n)
-
-void *run_func(void *f, void *v, void *as) {
- int arity = *((int *) v);
- fprintf(stderr, "calling function %p with arity %i\n", f, arity);
- list *l = (list *) as;
-
- void repeat_n_32(*arg_);
-
- if (arity == 0) return ((void *(*)()) f)();
- new_case(1);
- new_case(2);
- new_case(3);
- new_case(4);
- new_case(5);
- new_case(6);
- new_case(7);
- new_case(8);
- new_case(9);
- new_case(10);
- new_case(11);
- new_case(12);
- new_case(13);
- new_case(14);
- new_case(15);
- new_case(16);
- new_case(17);
- new_case(18);
- new_case(19);
- new_case(20);
- new_case(21);
- new_case(22);
- new_case(23);
- new_case(24);
- new_case(25);
- new_case(26);
- new_case(27);
- new_case(28);
- new_case(29);
- new_case(30);
- new_case(31);
- new_case(32);
- error(1, "arity %i not handled", arity);
-}
diff --git a/examples/tree.sin b/examples/tree.sin
deleted file mode 100644
index b11cae9..0000000
--- a/examples/tree.sin
+++ /dev/null
@@ -1,16 +0,0 @@
-[type branch_ [kind val l r]]
-[type leaf_ [kind val]]
-
-[dec == [a b]]
-
-[def branch [v l r]
- [branch_ 0 v l r]]
-
-[def leaf [x]
- [leaf_ 1 x]]
-
-[def is_branch [x]
- [== [branch_.kind x] 0]]
-
-[def is_leaf [x]
- [== [leaf_.kind x] 1]]
diff --git a/examples/util.sin b/examples/util.sin
deleted file mode 100644
index 5911a34..0000000
--- a/examples/util.sin
+++ /dev/null
@@ -1,2 +0,0 @@
-[def == [a b]
- [- a b]]