X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=parse-common.lisp;h=4c2855e282b6fa877e5789d399ccaeda3bbd9d09;hb=e6ef11f4c42de5a6754f73d9a714a0213b3a0133;hp=a0c7c2afce6afea1c94dbc0c132041be7d42238d;hpb=88be55a3921b3078570bb737da197c671117a719;p=umlisp.git diff --git a/parse-common.lisp b/parse-common.lisp index a0c7c2a..4c2855e 100644 --- a/parse-common.lisp +++ b/parse-common.lisp @@ -230,25 +230,17 @@ Currently, these are the LEX and NET files." "Returns umls-file structure for a filename" (find-if #'(lambda (f) (string= filename (fil f))) *umls-files*)) -(defvar *position-hash* (make-hash-table :test 'equal)) - (defun position-field-file (filename fieldname) "Returns the position of a field in a file" - (let ((key (cons filename fieldname))) - (multiple-value-bind (pos found) (gethash key *position-hash*) - (if found - (return-from position-field-file pos))) - - (let ((ufile (find-ufile filename))) - (unless ufile - (warn "Unable to find ufile for filename ~A." filename) + (let ((ufile (find-ufile filename))) + (unless ufile + (warn "Unable to find ufile for filename ~A." filename) + (return-from position-field-file nil)) + (let ((pos (position fieldname (fields ufile) :test #'string=))) + (unless pos + (warn "Unable to find field ~A in ufile ~S." fieldname ufile) (return-from position-field-file nil)) - (let ((pos (position fieldname (fields ufile) :test #'string=))) - (unless pos - (warn "Unable to find field ~A in ufile ~S." fieldname ufile) - (return-from position-field-file nil)) - (setf (gethash key *position-hash*) pos) - pos)))) + pos))) (defun find-ucols-for-ufile (ufile) "Returns list of umls-cols for a file structure"