diff --color -ur ktye/i/+/sqlite/sqlite.c sqlite/sqlite.c --- ktye/i/+/sqlite/sqlite.c 2024-05-26 20:39:33 +++ sqlite/sqlite.c 2024-06-06 14:16:18 @@ -49,13 +49,13 @@ default:; int nb = sqlite3_column_bytes(res, i); K c = KC((char *)sqlite3_column_blob(res, i), (size_t)nb); - l[i] = Kx(",", l[i], Kx(",", c)); // l,,c + l[i] = Kx(",", ref(l[i]), Kx(",:", c)); // l,,c } } row0 = 0; } - K t = Kx("+", Kx("!", keys, KL(l, cols))); + K t = Kx("+:", Kx("!", keys, KL(l, cols))); free(l); return t; @@ -67,10 +67,10 @@ static void addTable(sqlite3 *db, K name, K t){ // add k table to sqlite db (https://qastack.com.de/programming/1711631/improve-insert-per-second-performance-of-sqlite) K l2[2]; LK(l2,t); - K p = Kx(",", KC0("INSERT INTO "), Kx("$", ref(name))); // p:"insert into tname values(?,?,..)" + K p = Kx(",", KC0("INSERT INTO "), Kx("$:", ref(name))); // p:"insert into tname values(?,?,..)" p = Kx(",", p, KC0(" VALUES(")); - K q = Kx(",", KC0("CREATE TABLE "), Kx("$", name)); // q:"create table tname(col1 type1, col2 type2, ...)" + K q = Kx(",", KC0("CREATE TABLE "), Kx("$:", name)); // q:"create table tname(col1 type1, col2 type2, ...)" q = Kx(",", q, KC0("(")); size_t nc = NK(l2[0]); @@ -79,7 +79,7 @@ for(int i=0;i #include -#include"../k.h" +#include"k.h" // dgesv solve linear system (real) // x: L columns (input matrix) @@ -351,6 +351,8 @@ K dgesvD(K x){ return svd(x, 1, 'S'); } K zgesvd(K x){ return svd(x, 2, 'N'); } K zgesvD(K x){ return svd(x, 2, 'S'); } + +__attribute__((constructor)) void loadmat(); void loadmat(){ KR("dgesv", (void*)dgesv, 2); diff --color -ur ktye/i/+/mat/mat.k mat/mat.k --- ktye/i/+/mat/mat.k 2024-01-11 10:40:45 +++ mat/mat.k 2024-06-06 12:59:19 @@ -1,9 +1,10 @@ /lapack tests +`"libmat.dylib" 2:(`loadmat;1); -test:{x;y;$[x #include #include -#include"../k.h" +#include"k.h" #include @@ -290,6 +290,7 @@ static void rgb24(uint32_t *u, size_t n){ for(int i=0;i>16) | u[i]&0xff00; } +__attribute__((constructor)) void loaddrw(); void loaddrw(){ drawcmds = Kx("`color`font`linewidth`rect`Rect`circle`Circle`clip`line`poly`Poly`text`Text"); diff --color -ur ktye/i/+/draw/draw.k draw/draw.k --- ktye/i/+/draw/draw.k 2024-01-11 10:40:45 +++ draw/draw.k 2024-06-06 14:32:52 @@ -1,3 +1,5 @@ +`"libdraw.dylib"2:(`loaddrw;1); +`"libray.dylib"2:(`loadray;1); d:(`color;123;`Rect;0 0 100 50) m:draw[d;100 50] diff --color -ur ktye/i/+/ray/ray.c ray/ray.c --- ktye/i/+/ray/ray.c 2024-01-11 10:40:45 +++ ray/ray.c 2024-06-06 14:35:53 @@ -18,7 +18,7 @@ #include #include"raylib.h" #include"rgestures.h" -#include"../k.h" +#include"k.h" K png(K); // ../img/img.c @@ -131,7 +131,9 @@ } //show(50;10000#255) /red window 100x50 -K show(K x){ Show(x, Ki(0), Ki(0)); } +K show(K x){ Show(x, Ki(0), Ki(0)); return Ki(0); } + +__attribute__((constructor)) void loadray(); void loadray(){ KR("show", (void*)show, 1); // show image from data or png