Sounds about like most large codebases. Languages can't save you from this, it seems, only discipline can.
Also so cool that you worked in AI! That’s my dream field :)
You have a function (defun my-val () "a string")
Referentially transparent, easy to reason about right? Wrong. Lisp strings are mutable, and everything is a reference. So if you do something like this
(replace (my-val) "b" :start1 0 :end1 1)
(my-val) => "b string"
I appreciate that CL doesn't force everything to be immutable, but it seems like at least strings would benefit from being treated as immutable values.
I thought I could do (string "a string") to prevent it, but that didn't work.
(concatenate 'string "a string") worked, though ...
[0] http://www.lispworks.com/documentation/HyperSpec/Body/03_aba...
edit: i adjusted my answer because i thought i was answering to parent