Could you provide a minimal example that reproduces the problem you/re
having? It sounds like you're doing fairly complicated things with dynamic
function definitions etc.
You should probably not declare list-valued variables at all.
-s
On Fri, Oct 14, 2011 at 13:21, Panagiotis Papasotiriou <
p.j.papasot at gmail.com> wrote:
> Stavro,
> (I won't use my native language as you will understand but everybody else
> will blame me)
>
> Sometime ago, I already tried to translate my Maxima functions, without
> success. Following your suggestion, I decided to give it a second try. I
> declared all variables using mode_declare, but translation fails. The
> function I am trying to translate has the form
>
> rkf45(odes,funcs,interval):=block(
> [<local variables>],<mode declarations>,<body of the function>
> )
>
> Now, "funcs" is a dummy variable, which is supposed to be a list. Somewhere
> in the code, the following line causes an error:
>
> define(funmake(f_rhs,cons(interval[1],funcs)),odes),
>
> It says "cons: 2nd argument must be a non-atomic expression; found funcs".
> I suppose translator doesn't know funcs is a non-atomic expression. I tried
> to mode_declare funcs as a float, any, or even list (the latter is
> undocumented though). I still get the same error when I try to translate the
> code.
> Note that in the original Maxima code, function f_rhs is declared as local,
> but translator complains that "local" doesn't work well, so I removed
> local(f_rhs).
>
>
> 2011/10/14 Stavros Macrakis <macrakis at alum.mit.edu>
>
>> Panagioti,
>>
>> I certainly don't want to discourage you from learning Lisp, but I'm not
>> sure that rewriting numerical Maxima code by hand in Lisp will teach you
>> much. Working on symbolic computations in Lisp may be more educational and
>> productive.
>>
>> Have you tried using mode_declare, compile, and arrays (rather than Maxima
>> lists and matrices) for your numerical code? With proper declarations and
>> use of arrays, compiled Maxima code should be almost as fast as hand-written
>> Lisp numerical code or even scalar Fortran code.
>>
>> -s
>>
>> On Fri, Oct 14, 2011 at 05:48, Panagiotis Papasotiriou <
>> p.j.papasot at gmail.com> wrote:
>>
>>> Dear community, my question is only implicitly related to Maxima, but I
>>> am sure someone could help:
>>>
>>> I wrote some Numerical Analysis functions in Maxima, and they perform
>>> very well. However, I guess a Lisp implementation of those functions would
>>> be faster (and I wonder how faster it will be.) So I decided to rewrite the
>>> functions in Lisp (good opportunity to learn Lisp as well.) I am a big fan
>>> of Emacs, which I use extensively for Maxima sessions, gnuplot sessions, and
>>> as an IDE for Fortran 90 or C/C++ programming. As far I can tell, "Slime" is
>>> the Emacs package for Lisp programming. I installed Slime and SBCL (directly
>>> from Debian GNU/Linux repositories) but somehow those two are not connected,
>>> so I cannot, for example, mark a region of a Lisp program and execute it in
>>> SBCL with keystrokes like C-c C-b, as I do with Maxima programs. In fact,
>>> the Lisp program edited in Emacs seems completely on its own, not connected
>>> with SBCL in any way, although Slime is supposed to support SBCL. I tried
>>> several solutions which I found on the Internet, suggesting adding things in
>>> .emacs configuration file. However, none of those suggestions worked. So my
>>> question is, which is the "best" Lisp implementation I should use for
>>> Maxima-oriented Lisp programming, and how can I use it in Emacs?
>>>
>>> _______________________________________________
>>> Maxima mailing list
>>> Maxima at math.utexas.edu
>>> http://www.math.utexas.edu/mailman/listinfo/maxima
>>>
>>>
>>
>
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>
>