Skip to content

Commit

Permalink
Updating: very very minorly
Browse files Browse the repository at this point in the history
  • Loading branch information
githwxi committed Sep 14, 2024
1 parent 092c84b commit 4a8254d
Show file tree
Hide file tree
Showing 7 changed files with 177 additions and 15 deletions.
40 changes: 40 additions & 0 deletions prelude/DATS/VT/list000_vt.dats
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,46 @@ Authoremail: gmhwxiATgmailDOTcom
(* ****** ****** *)
//
(*
HX-2024-09-14:
Sat 14 Sep 2024 11:40:03 AM EDT
*)
//
#impltmp
< a: vt >
list_vt_make_1val
( x1 ) =
list_vt_cons(x1, list_vt_nil)
#impltmp
< a: vt >
list_vt_make_2val
(x1, x2) =
list_vt_cons(x1,
list_vt_cons(x2, list_vt_nil))
#impltmp
< a: vt >
list_vt_make_3val
(x1, x2, x3) =
list_vt_cons(x1,
list_vt_cons(x2,
list_vt_cons(x3, list_vt_nil)))
//
(* ****** ****** *)
(* ****** ****** *)
//
(*
HX-2024-09-14:
Sat 14 Sep 2024 11:40:03 AM EDT
*)
//
#impltmp
< a: vt >
list_vt_make_nfun =
nint_map_f1un_llist<a>(*void*)
//
(* ****** ****** *)
(* ****** ****** *)
//
(*
HX-2024-07-17:
Wed 17 Jul 2024 10:06:19 PM EDT
*)
Expand Down
2 changes: 1 addition & 1 deletion prelude/SATS/VT/list000_vt.sats
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ list_vt_make_nfun
#symload
list_vt with list_vt_make_nfun
#symload
list_vt_make with list_vt_make_nfun
list_vt_nfun with list_vt_make_nfun
//
(* ****** ****** *)
(* ****** ****** *)
Expand Down
34 changes: 27 additions & 7 deletions prelude/SATS/gint001.sats
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,19 @@ fun
nint_map_llist
{n0:i0}
(xs: nint(n0)): list_vt(y0, n0)
fun
<y0:vt>
nint_map_f1un_llist
{n0:i0}
(xs: nint(n0)
,f0: nintlt(n0)->y0): list_vt(y0, n0)
//
#symload
map_llist with nint_map_llist of 1000
#symload
map_llist with nint_map_f1un_llist of 1000
#symload
map_fun_llist with nint_map_f1un_llist of 1000
//
(* ****** ****** *)
//
Expand All @@ -169,9 +179,19 @@ fun
nint_rmap_llist
{n0:i0}
(xs: nint(n0)): list_vt(y0, n0)
fun
<y0:vt>
nint_rmap_f1un_llist
{n0:i0}
(xs: nint(n0)
,f0: nintlt(n0)->y0): list_vt(y0, n0)
//
#symload
map_llist with nint_rmap_llist of 1000
rmap_llist with nint_rmap_llist of 1000
#symload
rmap_llist with nint_rmap_f1un_llist of 1000
#symload
rmap_fun_llist with nint_rmap_f1un_llist of 1000
//
(* ****** ****** *)
(* ****** ****** *)
Expand All @@ -190,14 +210,14 @@ map_lstrm with nint_map_lstrm of 1000
//
fun
<y0:vt>
nint_map_lstrm_f1un
nint_map_f1un_lstrm
( xs: nint
, fopr: ( nint )->(y0)): strm_vt(y0)
//
#symload
map_lstrm with nint_map_lstrm_f1un of 1000
map_lstrm with nint_map_f1un_lstrm of 1000
#symload
map_lstrm_fun with nint_map_lstrm_f1un of 1000
map_fun_lstrm with nint_map_f1un_lstrm of 1000
//
(* ****** ****** *)
//
Expand All @@ -210,14 +230,14 @@ rmap_lstrm with nint_rmap_lstrm of 1000
//
fun
<y0:vt>
nint_rmap_lstrm_f1un
nint_rmap_f1un_lstrm
( xs: nint
, fopr: ( nint )->(y0)): strm_vt(y0)
//
#symload
rmap_lstrm with nint_rmap_lstrm_f1un of 1000
rmap_lstrm with nint_rmap_f1un_lstrm of 1000
#symload
rmap_lstrm_fun with nint_rmap_lstrm_f1un of 1000
rmap_fun_lstrm with nint_rmap_f1un_lstrm of 1000
//
(* ****** ****** *)
(* ****** ****** *)
Expand Down
15 changes: 15 additions & 0 deletions prelude/TEST/CATS/JS/Makefile_jsemit
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ all:: test05
all:: test06
all:: test07
all:: test08
all:: test09
all:: test99
########################################################################
########################################################################
Expand All @@ -31,6 +32,7 @@ testall:: test05; $(NODE) $<_out.js
testall:: test06; $(NODE) $<_out.js
testall:: test07; $(NODE) $<_out.js
testall:: test08; $(NODE) $<_out.js
testall:: test09; $(NODE) $<_out.js
########################################################################
testall1:: test00; $(NODE) $<_out1.js
########################################################################
Expand Down Expand Up @@ -207,6 +209,19 @@ npx google-closure-compiler -W QUIET \
--compilation_level ADVANCED --js=$@_out.js --js_output_file=$@_out2.js
########################################################################
########################################################################
test09:: ; \
echo "//" `date` > $@_out.js
############
test09:: ; \
$(CAT) $(SRCGEN2_XSHARED)/xats2js_js1emit.js >> $@_out.js
test09:: ; \
$(CAT) $(SRCGEN2_XSHARED)/xats2js_prelude.js >> $@_out.js
############
test09:: \
test09_llist00.dats; \
$(NODE) --stack-size=4096 $(SRCGEN2_XATS2JS) $< >> $@_out.js
########################################################################
########################################################################
test99:: ; \
echo "//" `date` > $@_out.js
############
Expand Down
43 changes: 43 additions & 0 deletions prelude/TEST/CATS/JS/test09_llist00.dats
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
(* ****** ****** *)
(*
HX-2024-08-09:
For testing prelude/JS!
*)
(* ****** ****** *)
(* ****** ****** *)
#staload _ =
"prelude/DATS/gdbg000.dats"
(* ****** ****** *)
(* ****** ****** *)
#include
"srcgen2\
/prelude/HATS/prelude_dats.hats"
(* ****** ****** *)
#include
"srcgen2\
/prelude/HATS/prelude_JS_dats.hats"
(* ****** ****** *)
(*
#include
"srcgen2\
/prelude/HATS/prelude_NODE_dats.hats"
*)
(* ****** ****** *)
(* ****** ****** *)
//
val ns =
list_vt_nfun(10, lam(i) => i)
val () = print0s("ns = ", ns, "\n")
//
(* ****** ****** *)
(* ****** ****** *)
//
val () = console_log(the_print_store_flush( (*void*) ))
//
(* ****** ****** *)
(* ****** ****** *)
//
(* ****** ****** *)(* ****** ****** *)(* ****** ****** *)
(* ****** ****** *)(* ****** ****** *)(* ****** ****** *)

(* end of [ATS3/XANADU_prelude_TEST_CATS_JS_test09_llist000.dats] *)
26 changes: 25 additions & 1 deletion srcgen1/prelude/SATS/VT/list000_vt.sats
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,35 @@ list_vt_length1
//
(* ****** ****** *)
//
//
fun
<a:vt>
list_vt_make_1val
(x1: a): list_vt(a,1)
fun
<a:vt>
list_vt_make_2val
(x1: a, x2: a): list_vt(a,2)
fun
<a:vt>
list_vt_make_3val
(x1: a
,x2: a, x3: a): list_vt(a,3)
//
(*
fun
<a:vt>
list_vt_make_nval
list_vt_make_ncpy
{n:nat}
(n0:sint(n), x0:a): list_vt(a,n)
*)
//
fun
<a:vt>
list_vt_make_nfun
{n:nat}
(n0: sint(n)
,f0: nintlt(n)->(a)): list_vt(a, n)
//
(* ****** ****** *)
//
Expand Down
32 changes: 26 additions & 6 deletions srcgen1/prelude/SATS/xunimpl.sats
Original file line number Diff line number Diff line change
Expand Up @@ -399,18 +399,38 @@ fun
nint_map_llist
{n0:i0}
(xs: nint(n0)): list_vt(y0, n0)
fun
<y0:vt>
nint_map_f1un_llist
{n0:i0}
(xs: nint(n0)
,f0: nintlt(n0)->y0): list_vt(y0, n0)
//
#symload
map_llist with nint_map_llist of 1000
#symload
map_llist with nint_map_f1un_llist of 1000
#symload
map_fun_llist with nint_map_f1un_llist of 1000
//
fun
<y0:vt>
nint_rmap_llist
{n0:i0}
(xs: nint(n0)): list_vt(y0, n0)
fun
<y0:vt>
nint_rmap_f1un_llist
{n0:i0}
(xs: nint(n0)
,f0: nintlt(n0)->y0): list_vt(y0, n0)
//
#symload
rmap_llist with nint_rmap_llist of 1000
#symload
rmap_llist with nint_rmap_f1un_llist of 1000
#symload
rmap_fun_llist with nint_rmap_f1un_llist of 1000
//
(* ****** ****** *)
(* ****** ****** *)
Expand All @@ -429,14 +449,14 @@ map_lstrm with nint_map_lstrm of 1000
//
fun
<y0:vt>
nint_map_lstrm_f1un
nint_map_f1un_lstrm
( xs: nint
, fopr: (nint)->(y0)): strm_vt(y0)
//
#symload
map_lstrm with nint_map_lstrm_f1un of 1000
map_lstrm with nint_map_f1un_lstrm of 1000
#symload
map_lstrm_fun with nint_map_lstrm_f1un of 1000
map_fun_lstrm with nint_map_f1un_lstrm of 1000
//
(* ****** ****** *)
//
Expand All @@ -454,14 +474,14 @@ rmap_lstrm with nint_rmap_lstrm of 1000
//
fun
<y0:vt>
nint_rmap_lstrm_f1un
nint_rmap_f1un_lstrm
( xs: nint
, fopr: (nint)->(y0)): strm_vt(y0)
//
#symload
rmap_lstrm with nint_rmap_lstrm_f1un of 1000
rmap_lstrm with nint_rmap_f1un_lstrm of 1000
#symload
rmap_lstrm_fun with nint_rmap_lstrm_f1un of 1000
rmap_fun_lstrm with nint_rmap_f1un_lstrm of 1000
//
(* ****** ****** *)
(* ****** ****** *)
Expand Down

0 comments on commit 4a8254d

Please sign in to comment.