|
From: Stavros M. <mac...@gm...> - 2024-10-14 19:00:49
|
Internally *makelist* calls *ev*, but I've got to say that that shocks me
even more than the fact that *ev* has bizarre behavior itself. In
particular, I find this ridiculous:
makelist(['(x), '('x),'('('x))],'x,17,17) => [[17, '17, '('17)]]
Re using *'x* as a variable in *ev* and *makelist*, I doubt that the
implementers considered that case. It should probably raise an error.
Also, I don't know what you're trying to investigate by testing with *''a* and
*''''a*. That syntax is evaluated at *read, *so those are precisely
equivalent to *b* and *c*.
-s
On Sun, Oct 13, 2024 at 7:00 PM Eduardo Ochs <edu...@gm...> wrote:
> On Sun, 13 Oct 2024 at 18:24, Stavros Macrakis <mac...@gm...> wrote:
>
>> To elaborate a bit on what Robert said, I strongly discourage you from
>> using *ev *programmatically if there is some other way to accomplish
>> what you want.
>>
>
>
>
> Hi all,
>
> I only tried to use ev because the documentation of makelist -
> from here:
>
> (info "(maxima)makelist")
> https://maxima.sourceforge.io/docs/manual/maxima_21.html#makelist
>
> says this:
>
> The most general form, 'makelist (<expr>, <i>, <i_0>, <i_max>,
> <step>)', returns the list of elements obtained when 'ev (<expr>,
> <i>=<j>)' is applied to the elements <j> of the sequence: <i_0>,
> <i_0> + <step>, <i_0> + 2*<step>, ..., with <|j|> less than or
> equal to <|i_max|>.
>
> and that gave me the impression that it was standard, or at least
> common, to use ev to explain the semantics of special forms... but I
> find ev very confusing - and I only tried to understand ev because
> I tried this,
>
> [a:'b, b:'c, c:'d]; /* [b,c,d] */
> ['a, a, ''a, ''''a]; /* [a,b,c,d] */
> makelist([a,b,c], 'a, 42,43); /* [[42,c,d], [43,c,d]] */
> makelist([a,b,c], a, 42,43); /* [[42,c,d], [43,c,d]] */
> makelist([a,b,c], ''a, 42,43); /* [[b,42,d], [b,43,d]] */
> makelist([a,b,c], ''''a, 42,43); /* [[b,c,42], [b,c,43]] */
>
> and I found the result of the first makelist very surprising.
>
> Anyway: now I have many more things in my to-do list... I need to
> finish some experiments with Sly/Slime (urgent), understand the last
> messages by Robert and Stavros (urgent), and learn how to use trace
> (not urgent). =/
>
> Cheers, thanks, etc...
> Eduardo
>
>
|