As of Tcl 8.5, 'apply' is a procedure defined by Tcl. However, the xmaxima Tcl script defines its own
'apply' proc that conflicts (especially as it has different semantics). This can cause errors to be
shown when xmaxima starts. For instance, tdbc 1.1.1 (included with Tcl 8.6) uses 'apply' in its
pkgIndex.tcl, and so that package index file fails to load (and tclsh writes out an error message).
Renaming 'apply' to 'mxapply' resolves this problem.
I have applied your patch. Thank you very much for your contribution.