FTYPE now accepts user defined function types (Josh Elsasser)

This commit is contained in:
Juan Jose Garcia Ripoll 2008-09-13 00:16:52 +02:00
parent fe923a9251
commit b31723d35d
2 changed files with 21 additions and 14 deletions

View file

@ -90,6 +90,9 @@ ECL 8.9.0:
- When a SETF place is a macro, it has to be expanded with MACROEXPAND-1.
- In FTYPE proclamations and declarations, the type may now be a user defined
function type (Josh Elsasser).
;;; Local Variables: ***
;;; mode:text ***
;;; fill-column:79 ***

View file

@ -206,13 +206,15 @@
(proclaim-var (second decl) (cddr decl))
(error "Syntax error in proclamation ~s" decl)))
(FTYPE
(let (ftype)
(cond ((and (consp (cdr decl))
(consp (setf ftype (second decl)))
(eq (first ftype) 'FUNCTION))
(dolist (v (cddr decl))
(add-function-proclamation v (rest ftype))))
(t (error "Syntax error in proclamation ~a" decl)))))
(if (atom (rest decl))
(error "Syntax error in proclamation ~a" decl)
(multiple-value-bind (type-name args)
(si::normalize-type (second decl))
(if (eq type-name 'FUNCTION)
(dolist (v (cddr decl))
(add-function-proclamation v args))
(error "In an FTYPE proclamation, found ~A which is not a function type."
(second decl))))))
(INLINE
(dolist (fun (cdr decl))
(if (si::valid-function-name-p fun)
@ -399,13 +401,15 @@
(COMPILATION-SPEED)
(t (cmpwarn "The OPTIMIZE quality ~s is unknown." (car x))))))))
(FTYPE
(let (ftype)
(cond ((and (consp (cdr decl))
(consp (setq ftype (second decl)))
(eq (first ftype) 'FUNCTION))
(dolist (v (cddr decl))
(add-function-declaration v (second ftype) (cddr ftype))))
(t (cmpwarn "Syntax error in declaration ~s" decl)))))
(if (atom (rest decl))
(cmpwarn "Syntax error in declaration ~a" decl)
(multiple-value-bind (type-name args)
(si::normalize-type (second decl))
(if (eq type-name 'FUNCTION)
(dolist (v (cddr decl))
(add-function-declaration v (first args) (rest args)))
(cmpwarn "In an FTYPE declaration, found ~A which is not a function type."
(second decl))))))
(INLINE
(push decl dl)
(dolist (fun (cdr decl))