Defining file_type extensions



ObsessiveMathsFreak <obsessivemathsfreak at obsessivemathsfreak.org>
writes:
> Hello,
>
> I've encountered a problem in the latest versions of
> maxima. Specially, the load function no longer works on my code
> because I have given the .mxs extension to all my code files. So now I
> have
>
> (%i3) load("weightingmatrix.mxs");
> Load failed for weightingmatrix.mxs
>  -- an error. To debug this try: debugmode(true);
>
> Simply renaming individual files solves this issue
>
> (%i4) load("weightingmatrix.mac");
> 0 errors, 0 warnings
> (%o4)                         weightingmatrix.mac
>
> But I have many dozens of mxs files which all contain mxs calls in
> their code. Rather than re-write everything, I would like to define
> mxs as a maxima file type so that file_type recognises it as maxima
> code.

The problem comes from the fact that load() can either load in lisp code
or Maxima code. To decide which it's getting, it seems to check for the
file extension, defaulting to lisp. So the errors you get come from it
trying to read weightingmatrix.mxs as lisp, which it isn't!

A solution/workaround is to use batchload() instead, which seems to work
the same, but assume that you're giving it Maxima code.

Rupert
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 315 bytes
Desc: not available
URL: <http://www.math.utexas.edu/pipermail/maxima/attachments/20110212/f7d76413/attachment.pgp>;