diff --git a/lama-spec.pdf b/lama-spec.pdf index 237cb3006..5362cfcb5 100644 Binary files a/lama-spec.pdf and b/lama-spec.pdf differ diff --git a/runtime/Std.i b/runtime/Std.i index 1ac1a69ee..ff5588005 100644 --- a/runtime/Std.i +++ b/runtime/Std.i @@ -54,3 +54,5 @@ F,kindOf; F,compareTags; F,flatCompare; F,tagHash; +F,uppercase; +F,lowercase; diff --git a/runtime/runtime.c b/runtime/runtime.c index 6f8c35c1e..ba9224121 100644 --- a/runtime/runtime.c +++ b/runtime/runtime.c @@ -566,6 +566,16 @@ static void stringcat (void *p) { } } +extern int Luppercase (void *v) { + ASSERT_UNBOXED("Luppercase:1", v); + return BOX(toupper ((int) UNBOX(v))); +} + +extern int Llowercase (void *v) { + ASSERT_UNBOXED("Llowercase:1", v); + return BOX(tolower ((int) UNBOX(v))); +} + extern int LmatchSubString (char *subj, char *patt, int pos) { data *p = TO_DATA(patt), *s = TO_DATA(subj); int n; diff --git a/runtime/runtime.h b/runtime/runtime.h index 16609672c..677429fd7 100644 --- a/runtime/runtime.h +++ b/runtime/runtime.h @@ -12,6 +12,7 @@ # include # include # include +# include # define WORD_SIZE (CHAR_BIT * sizeof(int)) diff --git a/spec/08.standard_library.tex b/spec/08.standard_library.tex index 207a0e207..19d4ada2b 100644 --- a/spec/08.standard_library.tex +++ b/spec/08.standard_library.tex @@ -12,6 +12,10 @@ is added implicitly by the compiler and can not be specified by an end user. The following declarations are accessible: +\descr{\lstinline|fun uppercase (n)|}{Convert \lstinline|n|, treated as ASCII code, into the code of the same symbol in upper case.} + +\descr{\lstinline|fun lowercase (n)|}{Convert \lstinline|n|, treated as ASCII code, into the code of the same symbol in lower case.} + \descr{\lstinline|fun assert (n, s, ...)|}{Asserts that \lstinline|n| is non-zero; otherwise raises \lstinline|failure| with a corresponding error message.} diff --git a/src/version.ml b/src/version.ml index 993b5c0f5..da4a1149e 100644 --- a/src/version.ml +++ b/src/version.ml @@ -1 +1 @@ -let version = "Version 1.10, 4d56ccc06, Sun Oct 3 17:10:21 2021 +0300" +let version = "Version 1.10, 594fa7bf8, Sat Oct 30 19:24:25 2021 +0300"