You're right, my suggestion ev(...) doesn't do it -- you need ev(...,
eval). infeval is overkill here, I think. As I say, I hate ev.
We should really define some clean functions for well-defined subsets of
the functionality of ev. In particular, eval(...) should do the obvious
thing. It is trivial to define: (defun $eval (x) (meval x)). Clean,
simple semantics.
Do we have any idea why Redfern et al. proposed this peculiar way of
handling indexed variables? Is it a workaround for the failure of
Maxima/Macsyma to treat subscripted variables as first-class variables in
some contexts? (Can we inventory those contexts and fix them
systematically?) Is it that they simply preferred the appearance of b2 to
b[2] in either linear or display2d form? Does some other system work this
way? ...?
-s
On Thu, Sep 26, 2013 at 3:34 AM, Jaime Villate <villate at fe.up.pt> wrote:
> On 26-09-2013 02:10, Stavros Macrakis wrote:
>
> Why infeval?
>
> Because that's what Redfern, Chandler and Fell propose in their book and I
> have not been able to find an alternative:
>
> (%i2) b2:4$
> (%i3) ev(concat(b,2));
> (%o3) b2
> (%i4) ev(ev(concat (b,2)));
> (%o4) b2
> (%i5) ev(concat (b,2),infeval);
> (%o5) 4
>
> do you know another way to get the value 4 without using ''(...) ?
>
> Jaime
>
> -s
> On Sep 25, 2013 12:47 PM, "Jaime Villate" <villate at fe.up.pt> wrote:
>
>> I think that the result Christian was expecting is what you get from:
>>
>> for j:1 thru 2 do (
>> concat (b,j) :: 10*j,
>> print (ev (concat (b,j), infeval)));
>>
>> There is a very nice old book: Darren Redfern, Edgar Chandler and Richard
>> N. Fell, Macsyma ODE Lab Book, 1998, where the authors use concat() and
>> ''(...) very intensely.
>> They do switch from ''(concat(...)) to ev(concat(...),infeval) inside for
>> loops.
>>
>> I do agree that concat(...) and ''(...) should be avoided in favor of
>> other better ways to do the same.
>> Regards,
>> Jaime
>>
>
>