starting [nap] (nat archive project)

This commit is contained in:
2021-05-16 23:38:57 -06:00
parent ed8b1191cb
commit 2083b90df0
6 changed files with 34 additions and 0 deletions

5
projects/nap/build.hxml Normal file
View File

@@ -0,0 +1,5 @@
-lib uuid
-lib kiss
-cp src
--main Main
--interp

View File

@@ -0,0 +1,8 @@
package;
import kiss.Kiss;
import kiss.Prelude;
import uuid.Uuid;
@:build(kiss.Kiss.build())
class Entry {}

View File

@@ -0,0 +1,3 @@
(defnew [&prop :String name]
[:String id (Uuid.v4)
:Map<String,kiss.List<Dynamic>> components (new Map)])

7
projects/nap/src/Main.hx Normal file
View File

@@ -0,0 +1,7 @@
package;
import kiss.Kiss;
import kiss.Prelude;
@:build(kiss.Kiss.build())
class Main {}

View File

@@ -0,0 +1,8 @@
(defun :Void main []
(let [e (new Entry "name")]
(dictSet e.components "f" [5])
(dictSet e.components "b" [(object c "d")])
(let [s (haxe.Json.stringify e)
:Entry e2 (haxe.Json.parse s)]
// can't call Entry methods on e2
(print s))))

3
projects/nap/test.sh Normal file
View File

@@ -0,0 +1,3 @@
#! /bin/bash
haxe build.hxml