X-Git-Url: http://git.kpe.io/?p=umlisp-orf.git;a=blobdiff_plain;f=parse-macros.lisp;h=70210fb4006ea341f02d79c6a49415116d51acea;hp=dd79bd76c0f7dce573ad5224d17b0854c3732093;hb=HEAD;hpb=d8fe27c58aa49f4a19f8b0dc11f97e0db7662e9e diff --git a/parse-macros.lisp b/parse-macros.lisp index dd79bd7..70210fb 100644 --- a/parse-macros.lisp +++ b/parse-macros.lisp @@ -21,40 +21,40 @@ (defmacro with-umls-file ((line filename) &body body) "Opens a UMLS and processes each parsed line with (body) argument" (let ((ustream (gensym "STRM-")) - (eof (gensym "EOF-"))) + (eof (gensym "EOF-"))) `(let ((,eof (gensym "EOFSYM-"))) (with-open-file - (,ustream (umls-pathname ,filename) :direction :input) - (do ((,line (read-umls-line ,ustream ,eof) - (read-umls-line ,ustream ,eof))) - ((eq ,line ,eof) t) - ,@body))))) + (,ustream (umls-pathname ,filename) :direction :input) + (do ((,line (read-umls-line ,ustream ,eof) + (read-umls-line ,ustream ,eof))) + ((eq ,line ,eof) t) + ,@body))))) (defmacro with-buffered-umls-file ((line filename) &body body) "Opens a UMLS and processes each parsed line with (body) argument" (let ((ustream (gensym "STRM-")) - (buffer (gensym "BUF-")) - (eof (gensym "EOF-"))) + (buffer (gensym "BUF-")) + (eof (gensym "EOF-"))) `(let ((,buffer (make-fields-buffer)) - (,eof (gensym "EOFSYM-"))) + (,eof (gensym "EOFSYM-"))) (with-open-file - (,ustream (umls-pathname ,filename) :direction :input) - (do ((,line (read-buffered-fields ,buffer ,ustream #\| ,eof) - (read-buffered-fields ,buffer ,ustream #\| ,eof))) - ((eq ,line ,eof) t) - ,@body))))) + (,ustream (umls-pathname ,filename) :direction :input) + (do ((,line (read-buffered-fields ,buffer ,ustream #\| ,eof) + (read-buffered-fields ,buffer ,ustream #\| ,eof))) + ((eq ,line ,eof) t) + ,@body))))) (defmacro with-buffered2-umls-file ((line filename) &body body) "Opens a UMLS and processes each parsed line with (body) argument" (let ((ustream (gensym "STRM-")) - (buffer (gensym "BUF-")) - (eof (gensym "EOF-"))) + (buffer (gensym "BUF-")) + (eof (gensym "EOF-"))) `(let ((,buffer (make-fields-buffer2)) - (,eof (gensym "EOFSYM-"))) + (,eof (gensym "EOFSYM-"))) (with-open-file - (,ustream (umls-pathname ,filename) - :direction :input :if-exists :overwrite) - (do ((,line (read-buffered-fields ,buffer ,ustream #\| ,eof) - (read-buffered-fields ,buffer ,ustream #\| ,eof))) - ((eq ,line ,eof) t) - ,@body))))) + (,ustream (umls-pathname ,filename) + :direction :input :if-exists :overwrite) + (do ((,line (read-buffered-fields ,buffer ,ustream #\| ,eof) + (read-buffered-fields ,buffer ,ustream #\| ,eof))) + ((eq ,line ,eof) t) + ,@body)))))