|
From: Robert D. <rob...@gm...> - 2024-10-15 05:32:27
|
On Mon, Oct 14, 2024 at 12:00 PM Stavros Macrakis <mac...@gm...> wrote:
> 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.
Ah, but this example is easily explained. 'x is a nonatomic expression
((MQUOTE) $X) so ev is going to substitute (not assign) ?meval(17) for
?meval('x) in ['(x), '('x),'('('x))] and then evaluate that, peeling
off one quote from each of the three list elements. (I'm pretty
impressed that it comes out with the right number of quotes on each
element, frankly.)
I disagree that 'x should cause an error, unless all nonatomic doodads
cause an error, and I'm inclined to think they shouldn't.
The barely-coherent intricacies of ev spill over into makelist ... Oh well!!
Robert
|