(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)))))