diff --git a/contrib/README b/contrib/README index 7ab19f08c..8899d374c 100644 --- a/contrib/README +++ b/contrib/README @@ -1,14 +1,16 @@ -###### start of [README] ###### +################################################################## +######################## beg of [README] ######################### +################################################################## This is a place for contributed code. -In general, if you have a question on something -(e.g., the syntax of ATS3), please open an issue -on Github. +In general, if you have a question on something (e.g., the syntax +of ATS3), please open an issue on Github. -There is a library libxatsopt for ATS3(ATS/Xanadu). -If you create a tool for ATS3, you may want to consider -using this library (instead of relying on the source -code for ATS3). +There is a library for ATS3(ATS/Xanadu) that is given the name +[libxatsopt]. If you create a tool for ATS3, please consider using +this library (instead of relying on the source code for ATS3). -###### finish of [README] ###### +################################################################## +######################## end of [README] ######################### +################################################################## diff --git a/prelude/SATS/bool000.sats b/prelude/SATS/bool000.sats index 5459305d9..6585692c5 100644 --- a/prelude/SATS/bool000.sats +++ b/prelude/SATS/bool000.sats @@ -161,7 +161,7 @@ fun bool_ifval {b:b0} -(b: bool(b), x: a, y: a): (a) +(b: bool(b), x: a, y: a): (a) // fun // #symload ifval with bool_ifval of 1000 // diff --git a/prelude/TEST/CATS/JS/DATA/data00_fact000.dats b/prelude/TEST/CATS/JS/DATA/data00_fact000.dats new file mode 100644 index 000000000..f7ca2b5c0 --- /dev/null +++ b/prelude/TEST/CATS/JS/DATA/data00_fact000.dats @@ -0,0 +1,15 @@ +(* ****** ****** *) +(* ****** ****** *) +// +fun +fact_loop(i, r) = +if i < fact_n +then fact_loop(i+1, (i+1)*r) else r +// +(* ****** ****** *) +(* ****** ****** *) +// +(* ****** ****** *)(* ****** ****** *)(* ****** ****** *) +(* ****** ****** *)(* ****** ****** *)(* ****** ****** *) + +(* end of [ATS3/XANADU_prelude_TEST_CATS_JS_DATA_data00_fact000.dats] *) diff --git a/prelude/TEST/CATS/JS/test99_mydiary.dats b/prelude/TEST/CATS/JS/test99_mydiary.dats index 429cba860..4004c369c 100644 --- a/prelude/TEST/CATS/JS/test99_mydiary.dats +++ b/prelude/TEST/CATS/JS/test99_mydiary.dats @@ -57,6 +57,26 @@ val ( ) = prints("ABAB = ", ABAB, "\n") (* ****** ****** *) (* ****** ****** *) // +fun +fact(n: sint): sint = +fact_loop(0(*i*), 1(*r*)) +where +{ + val + fact_n = n + #include "./DATA/data00_fact000.dats" } +// +(* ****** ****** *) +// +local +val N0 = 10 +val () = +prints("fact(", N0, ") = ", fact(N0), "\n") +endloc//local +// +(* ****** ****** *) +(* ****** ****** *) +// (* ****** ****** *)(* ****** ****** *)(* ****** ****** *) (* ****** ****** *)(* ****** ****** *)(* ****** ****** *)