From e1ae4b73abdbbfe03c47f728de05e0aabbedb291 Mon Sep 17 00:00:00 2001 From: dos-reis Date: Fri, 12 Aug 2011 00:43:54 +0000 Subject: * interp/define.boot (NRTgetLookupFunction): Handle the case where the base domain is a parameter. * interp/g-util.boot (formalVarNumber): New. * lisp/core.lisp.in (readIntegerIfCan): Likewise. --- src/lisp/core.lisp.in | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/lisp') diff --git a/src/lisp/core.lisp.in b/src/lisp/core.lisp.in index 46d5306f..3ecb6c48 100644 --- a/src/lisp/core.lisp.in +++ b/src/lisp/core.lisp.in @@ -101,6 +101,7 @@ "prettyPrint" "readLine" "readExpr" + "readIntegerIfCan" ;; compiler data structures "%Mode" @@ -527,6 +528,11 @@ (defmacro |readExpr| (f) `(read ,f nil |%nothing|)) +(defun |readIntegerIfCan| (s) + (let ((r (multiple-value-call #'cons (parse-integer s :junk-allowed t)))) + (cond ((eql (cdr r) (length s)) (car r)) + (t nil)))) + ;; Pretty-print a lisp form on a given output stream. (defun |prettyPrint| (x &optional (s |$OutputStream|)) (let ((*print-pretty* t) -- cgit v1.2.3