- (eval (f90-make-type-struct type slots))
- (setq fn (intern-soft (format "make-f90-type.%s" type)))
- (unless fn
- (error "Something bad went wrong parsing type definition %s" type))
- (setf (gethash type f90-types) (funcall fn))))
-
-(defun f90-make-type-struct (type slots)
- "Create a struct describing TYPE with SLOTS."
- (let ((struct-name (make-symbol (format "f90-type.%s" type)))
- (varnames (reverse (mapcar (lambda (x)
- (setq x (car x))
- (if (string-match "\\([^(]+\\)(" x)
- (match-string 1 x)
- x)) slots))))
- `(defstruct (,struct-name
- (:conc-name ,(make-symbol (format "f90-type.%s." type))))
- (-varnames ',varnames :read-only t)
- ,@(loop for (name . rest) in slots
- collect `(,(make-symbol name) (cons ',name ',rest)
- :read-only t)))))