Ever used Smalltalk, Dylan or Common Lisp commercial tools?
But, OTOH, I am aware that its possible to do good-enough-for-many-uses implementations of things for which a complete, general solution is impossible, including the function described.
http://devblog.avdi.org/2015/05/11/in-which-i-make-you-hate-...