From da334a99fa9e66215133f4cf5fe87a3b78d7084e Mon Sep 17 00:00:00 2001 From: dos-reis Date: Wed, 5 Oct 2011 12:38:09 +0000 Subject: * lisp/core.lisp.in (eof?): New. (listToString): Likewise. (formatToString): Likewise. * boot/tokens.boot: Add fifth as builtin library function. --- src/lisp/core.lisp.in | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/lisp') diff --git a/src/lisp/core.lisp.in b/src/lisp/core.lisp.in index ba19d87f..d9bce925 100644 --- a/src/lisp/core.lisp.in +++ b/src/lisp/core.lisp.in @@ -98,10 +98,12 @@ "outputTextFile" "closeFile" "closeStream" + "eof?" "prettyPrint" "readLine" "readExpr" "readIntegerIfCan" + "formatToString" ;; compiler data structures "%Mode" @@ -138,6 +140,7 @@ "makeByteArray" "makeBitVector" "makeString" + "listToString" "%hasFeature" "%systemOptions" @@ -525,6 +528,9 @@ (defmacro |closeStream| (s) `(close ,s)) +(defmacro |eof?| (s) + `(null (peek-char nil ,s nil nil nil))) + ;; Read a line from the input text file. Quietly return ;; %nothing at end of file. (defmacro |readLine| (f) @@ -550,6 +556,9 @@ (*print-level* nil)) (prin1 x s))) +(defmacro |formatToString| (&rest args) + `(format nil ,@args)) + ;; ;; -*- OpenAxiom filesystem -*- ;; @@ -1373,6 +1382,14 @@ (defun |makeString| (n &optional (c (code-char 0))) (make-string n :initial-element c)) +(defun |listToString| (l) + (let ((s (|makeString| (list-length l)))) + (do ((i 0 (1+ i))) + (null l) + (setf (schar s i) (car l)) + (setq l (cdr l))) + s)) + ;; native data type translation table (defconstant |$NativeTypeTable| '((|void| . @void_type@) -- cgit v1.2.3