diff --git a/lama-spec.pdf b/lama-spec.pdf index 02dc803f7..c9be9504f 100644 Binary files a/lama-spec.pdf and b/lama-spec.pdf differ diff --git a/runtime/Std.i b/runtime/Std.i index 65e32159e..b3ff0f94a 100644 --- a/runtime/Std.i +++ b/runtime/Std.i @@ -1,3 +1,4 @@ +F,assert; F,getEnv; F,system; V,sysargs; diff --git a/runtime/runtime.c b/runtime/runtime.c index 54f6ebbcd..117844e89 100644 --- a/runtime/runtime.c +++ b/runtime/runtime.c @@ -151,6 +151,15 @@ static void failure (char *s, ...) { vfailure (s, args); } +void Lassert (void *f, char *s, ...) { + if (!UNBOX(f)) { + va_list args; + + va_start (args, s); + vfailure (s, args); + } +} + # define ASSERT_BOXED(memo, x) \ do if (UNBOXED(x)) failure ("boxed value expected in %s\n", memo); while (0) # define ASSERT_UNBOXED(memo, x) \ diff --git a/spec/07.standard_library.tex b/spec/07.standard_library.tex index c514ad417..525d01063 100644 --- a/spec/07.standard_library.tex +++ b/spec/07.standard_library.tex @@ -12,6 +12,9 @@ is added implicitly by the compiler and can not be specified by an end user. The following declarations are accessible: +\descr{\lstinline|fun assert (n, s, ...)|}{Asserts that \lstinline|n| is non-zero; otherwise raises \lstinline|failure| with + a corresponding error message.} + \descr{\lstinline|fun stringInt (s)|}{Converts a string representation of a signed decimal number into integer.} \descr{\lstinline|fun read ()|}{Reads an integer value from the standard input, printing a prompt "\lstinline|>|".} diff --git a/src/stdpath.ml b/src/stdpath.ml index c85a32af0..3ea09b8ff 100644 --- a/src/stdpath.ml +++ b/src/stdpath.ml @@ -1 +1 @@ -let path = "/home/db/.opam/4.07.1+fp/share/Lama" +let path = "/home/db/.opam/4.07.1+fp+flambda/share/Lama" diff --git a/src/version.ml b/src/version.ml index 7c82e5147..cfc8d681e 100644 --- a/src/version.ml +++ b/src/version.ml @@ -1 +1 @@ -let version = "Version 1.00, 19252991a, Thu Dec 24 02:54:54 2020 +0300" +let version = "Version 1.00, eeddb0b25, Tue Jan 12 01:14:18 2021 +0300"