X-Git-Url: http://git.kpe.io/?p=lml.git;a=blobdiff_plain;f=2%2Futils.lisp;h=a90b32585b765c4a48c16d169fe141bdb55d0c86;hp=a275a3e95eac802a7b0b8ebbff5c2e9504865e8e;hb=56101303de2ecd982a094e354a4d4d2eb1547d81;hpb=2f8ada779df91c53895da2ff0c18dd87b6cde3da diff --git a/2/utils.lisp b/2/utils.lisp index a275a3e..a90b325 100644 --- a/2/utils.lisp +++ b/2/utils.lisp @@ -1,6 +1,18 @@ -;;; $Id: utils.lisp,v 1.2 2003/06/28 08:18:21 kevin Exp $ +;;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; Base: 10 -*- +;;;; ************************************************************************* +;;;; FILE IDENTIFICATION ;;;; -;;;; General purpose utilities +;;;; Name: utils.lisp +;;;; Purpose: General purpose utilities +;;;; Author: Kevin M. Rosenberg +;;;; Date Started: June 2002 +;;;; +;;;; $Id: utils.lisp,v 1.3 2003/07/12 17:54:05 kevin Exp $ +;;;; +;;;; This file, part of LML2, is copyrighted and open-source software. +;;;; Rights of modification and redistribution are in the LICENSE file. +;;;; +;;;; ************************************************************************* (in-package #:lml2) @@ -12,26 +24,6 @@ `(aif ,test-form (progn ,@body))) -(defun keyword-symbol? (x) - "Returns T if object is a symbol in the keyword package" - (and (symbolp x) - (string-equal "keyword" (package-name (symbol-package x))))) - -(defun list-to-spaced-string (list) - (format nil "~{~A~^ ~}" list)) - -(defun print-n-chars (char n stream) - (declare (fixnum n) - (optimize (speed 3) (safety 0) (space 0))) - (do ((i 0 (1+ i))) - ((= i n) char) - (declare (fixnum i)) - (write-char char stream))) - -(defun indent-spaces (n &optional (stream *standard-output*)) - "Indent n*2 spaces to output stream" - (print-n-chars #\space (+ n n) stream)) - (defun print-file-contents (file &optional (strm *standard-output*)) "Opens a reads a file. Returns the contents as a single string" (when (probe-file file)