An example would be if presence in a collection is dependent on mutable properties of its entries.
Most lisps generally do it this way (except maybe emacs lisp?), but there's not really a requirement for it to be a language feature. TCO is really just AST manipulation, and lisp macros are more than capable of that, although you might want to hook into the reader as well if Kamila supports it (I didn't see anything about that in the github readme).
While it is true that tail call relationships can always be represented using goto, it requires that all related code is known to make this conversion. For instance:
(defun f (x) (a x) (g x))
(defun g (x) (b x) (h x))
(defun h (x) (c x) (f x))
You cannot remove the tail call by altering the AST of F, G, or H. Instead, a third function must be instroduced that contains the bodies of all functions in the loop. (defun fgh-loop (start-at x)
(tagbody
(case start-at
((f) (go f))
((g) (go g))
((h) (go h)))
f (a x) (go g)
g (b x) (go h)
h (c x) (go f)))
(defun f (x) (fgh-loop 'f x))
(defun g (x) (fgh-loop 'g x))
(defun h (x) (fgh-loop 'h x))
You can only apply such optimisations in retrospect, but a macro would only have access to the body of F at the point of definition for F. And even then, you cannot TCO any lambdas that are passed around. A simple example is the Y combinator: ((lambda (x) (x x)) (lambda (x) (x x)))There's no actual reason for this, you can get the symbol tree for the functions in question, assuming the runtime allows this (several do), and re-compile them and blow over the old definitions. You can only apply the optimization once all of f, g, and h are defined, there's no rule saying that a macro can only modify the function being defined, or that other functions can't be defined (the CLOS would be impossible if that were the case).
Both this and the lambda example should be doable with function-lambda-expression, although it's not exactly standardized. It should be possible in principal with the right implementation.