- (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)))))
+ (buffer (gensym "BUF-"))
+ (eof (gensym "EOF-"))
+ (files (gensym "FILES-")))
+ `(let ((,eof (gensym "EOFSYM-"))
+ (,buffer (make-fields-buffer))
+ (,files (source-files ,path)))
+ (with-open-file (,ustream (first ,files) :direction :input
+ #+(and sbcl sb-unicode) :external-format
+ #+(and sbcl sb-unicode) :UTF-8
+ #+(and allegro ics) :external-format
+ #+(and allegro ics) :UTF-8
+ #+lispworks :external-format
+ #+lispworks :UTF-8
+ #+(and clisp unicode) :external-format
+ #+(and clisp unicode) charset:utf-8)
+ (do ((,line (read-buffered-fields ,buffer ,ustream #\| ,eof)
+ (read-buffered-fields ,buffer ,ustream #\| ,eof)))
+ ((eq ,line ,eof) t)
+ (setq ,line (coerce ,line 'list))
+ (print ,line)
+ ,@body)))))