On 8/10/2006 3:29:37 AM, VFO wrote:
>Please - see attach
I had a brief look last night at the expression compiler Tom referenced earlier in the thread.
Unfortunately, as Tom alluded, M13 static type checking severely breaks the underlying structure of the compiler.
M13 and M12 do not allow arrays to mix functions and scalars, nor do they allow a function to accept a function as a parameter unless all such functions have the same number of arguments.
For example:
x:=[1 2 sin]
and
f(g,v):=
g(v) if IsScalar(v)
g(v
0,v
1) if rows(v)=2
g(v
0,v
1,v
2) otherwise
are both legal and useful constructs in M11 but are illegal in M12 and M13.
The compiler makes use of these constructs and hence fails under M13.
It may be possible to rewrite the compiler by splitting up the arrays and having separate handling for monadic and dyadic functions, but the result will be quite messy and lose the elegance of Tom's implementation.
I believe that the following thread partially addresses some of the issues (I'm Mathcadless so can't check)
http://collab.mathsoft.com/read?75228,85e#75228Like Tom, I have several *very* useful M11 worksheets that are conceptually simple but which would require a total rewrite to get working in M13, and introduce a maintenance nightmare in the process ... provided I could find a way round all of the difficulties.
Stuart
(M13 is a lot better than M12, where I've never found a workaround for most of my sheets).