COMPOSE and its variants are probably unsafe
COMPOSE
includes this expression:
(lambda (&rest arguments)
(declare (dynamic-extent arguments))
(funcall f (apply g arguments)))))
where f
and g
are unknown functions.
I think this is not safe, because
When the function receives its arguments via &rest, it is permissible (but not required) for the implementation to bind the rest parameter to an object that shares structure with the last argument to apply.
So if g
takes an &rest
list this may share structure with arguments
. But a perfectly legitimate definition of g
would be
(lambda (&rest args) args)
which could then return the list of arguments outside its dynamic extent.
I am not aware of implementations which have this behaviour for apply
, however.