mirror of
https://github.com/ProgramSnail/Lama.git
synced 2025-12-05 22:38:44 +00:00
Sexpr tags fixed
This commit is contained in:
parent
cbd715339f
commit
ac853957ae
6 changed files with 22 additions and 3 deletions
BIN
lama-spec.pdf
BIN
lama-spec.pdf
Binary file not shown.
|
|
@ -338,7 +338,7 @@ char* de_hash (int n) {
|
|||
static char *chars = (char*) BOX (NULL);
|
||||
static char buf[6] = {0,0,0,0,0,0};
|
||||
char *p = (char *) BOX (NULL);
|
||||
chars = "_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
||||
chars = "_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'";
|
||||
p = &buf[5];
|
||||
|
||||
#ifdef DEBUG_PRINT
|
||||
|
|
|
|||
|
|
@ -102,6 +102,14 @@ Generic data manupulation.
|
|||
\descr{\lstinline|infix =?= at < (x, y)|}{A generic comparison operator similar to \lstinline|compare|, but capable of handling cyclic/shared data structures.}
|
||||
\descr{\lstinline|infix === at == (x, y)|}{A generic equality operator capable of handling cyclic/shared data structures.}
|
||||
|
||||
\section{Unit \texttt{Timer}}
|
||||
\label{sec:timer}
|
||||
|
||||
A simple timer.
|
||||
|
||||
\descr{\lstinline|fun timer ()|}{Creates a timer. Creates a zero-argument function which, being called, returns the elapsed time in microseconds since its creation.}
|
||||
\descr{\lstinline|fun toSeconds (n)|}{Converts an integer value, interpreted as microseconds, into a floating-point string.}
|
||||
|
||||
\section{Unit \texttt{Random}}
|
||||
\label{sec:random}
|
||||
|
||||
|
|
|
|||
|
|
@ -511,7 +511,7 @@ module M = Map.Make (String)
|
|||
|
||||
(* Environment implementation *)
|
||||
class env prg =
|
||||
let chars = "_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" in
|
||||
let chars = "_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'" in
|
||||
let make_assoc l i = List.combine l (List.init (List.length l) (fun x -> x + i)) in
|
||||
let rec assoc x = function [] -> raise Not_found | l :: ls -> try List.assoc x l with Not_found -> assoc x ls in
|
||||
object (self)
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
let version = "Version 1.00, f08cd8396, Sat Aug 22 20:11:41 2020 +0300"
|
||||
let version = "Version 1.00, cbd715339, Sun Aug 23 00:18:53 2020 +0300"
|
||||
|
|
|
|||
|
|
@ -12,3 +12,14 @@ public fun timer () {
|
|||
time () - t
|
||||
}
|
||||
}
|
||||
|
||||
-- Formats a given time as a floating-point number
|
||||
public fun toSeconds (t) {
|
||||
local s = sprintf ("%d", t);
|
||||
|
||||
if s.length >= 7
|
||||
then
|
||||
sprintf ("%s.%s", substring (s, 0, s.length - 7 + 1), substring (s, s.length - 7 + 1, 6))
|
||||
else sprintf ("0.%s", s)
|
||||
fi
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue