aboutsummaryrefslogtreecommitdiffstats
path: root/subsystem/karuta/rnt.lfe
diff options
context:
space:
mode:
authorMarcos Magueta <maguetamarcos@gmail.com>2026-10-24 22:07:40 -0300
committerMarcos Magueta <maguetamarcos@gmail.com>2026-10-24 22:07:40 -0300
commit4994bc0aacf08cf69bfaa3e31bd6767050f55efd (patch)
tree3d21152a1829232ce0a2d0d1808338fff834e2da /subsystem/karuta/rnt.lfe
parent8dd98ab247db83c6e7a49676f562f2cf18237700 (diff)
downloadRNT-4994bc0aacf08cf69bfaa3e31bd6767050f55efd.tar.gz
RNT-4994bc0aacf08cf69bfaa3e31bd6767050f55efd.zip
proper beam evaluator
Diffstat (limited to 'subsystem/karuta/rnt.lfe')
-rw-r--r--subsystem/karuta/rnt.lfe26
1 files changed, 0 insertions, 26 deletions
diff --git a/subsystem/karuta/rnt.lfe b/subsystem/karuta/rnt.lfe
deleted file mode 100644
index dc0fbb7..0000000
--- a/subsystem/karuta/rnt.lfe
+++ /dev/null
@@ -1,26 +0,0 @@
-;; Tuples of an RNT relation, as Translator.ml writes and reads them: a
-;; tuple is #(Type #m(Name Value ...)), its type, names and strings
-;; binaries, and its integers no wider than an OCaml int.
-(defmodule rnt
- (export (recv 1) (send 1)))
-
-;; A tuple from the bytes RNT sent.
-(defun recv (bytes) (holdable (binary_to_term bytes '(safe))))
-
-;; The bytes RNT reads a tuple from.
-(defun send (tuple) (term_to_binary (holdable tuple)))
-
-;; The tuple, if RNT can hold it.
-(defun holdable
- (((= (tuple type attributes) tuple)) (when (is_binary type) (is_map attributes))
- (if (lists:all (fun attribute? 1) (maps:to_list attributes))
- tuple
- (error 'badarg (list tuple))))
- ((tuple) (error 'badarg (list tuple))))
-
-(defun attribute?
- (((tuple name value)) (when (is_binary name) (is_binary value)) 'true)
- (((tuple name value))
- (when (is_binary name) (is_integer value) (>= value (- (bsl 1 62))) (< value (bsl 1 62)))
- 'true)
- ((_) 'false))