diff options
author | Darren Bane <darren.bane@gmail.com> | 2021-05-16 00:22:22 +0100 |
---|---|---|
committer | Darren Bane <darren.bane@gmail.com> | 2021-05-16 00:22:22 +0100 |
commit | 58dce9acc5ce063e979f572e3cae040599918f8d (patch) | |
tree | e3a2bb34e55c588a8fa4fa006d9de9c5e86ab198 | |
parent | af38818bb582e212b5f52566a71cede0d1675d29 (diff) | |
download | lsp-58dce9acc5ce063e979f572e3cae040599918f8d.tar.gz |
Fix non-standard syntax
-rw-r--r-- | bitmap.lsp | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/bitmap.lsp b/bitmap.lsp index 41d3f64..aaef3a5 100644 --- a/bitmap.lsp +++ b/bitmap.lsp @@ -1,6 +1,8 @@ ;;; Bitmap ;;; This could be extended to a general drawing interface, but for now it's probably better to use Tk's canvas. +(import "compat") + (defconstant +black+ 0) (defconstant +white+ #xFFFFFF) (defconstant +red+ #xFF0000) @@ -81,13 +83,16 @@ (defconstant +whitespace-chars+ '(#\SPACE \#carriage-return #\TAB #\NEWLINE)) -(defun read-header-chars (stream &optional (delimiter-list +whitespace-chars+)) - (do ((c (read-char stream nil :eof) - (read-char stream nil :eof)) - (vals nil (if (or (null c) (char= c #\#)) vals (cons c vals)))) ;;don't collect comment chars - ((or (eql c :eof) (member c delimiter-list)) (map 'string #'identity (nreverse vals))) ;;return strings - (when (char= c #\#) ;;skip comments - (read-line stream)))) +(defun read-header-chars (stream &rest args) + (let ((delimiter-list (if (null args) + +whitespace-chars+ + (car args)))) + (do ((c (read-char stream nil :eof) + (read-char stream nil :eof)) + (vals nil (if (or (null c) (char= c #\#)) vals (cons c vals)))) ;;don't collect comment chars + ((or (eql c :eof) (member c delimiter-list)) (map 'string #'identity (nreverse vals))) ;;return strings + (when (char= c #\#) ;;skip comments + (read-line stream))))) (defun read-ppm-file-header (file) (with-open-file (s file :direction :input) |