From: Barton W. <wi...@un...> - 2025-03-06 11:16:42
|
FYI: In case somebody doesn't know, the functions cons and friends are more general than are push and pop; for example: (%i1) cons(3,a*b); (%o1) 3 a b (%i2) cons(p+q, a*b); (%o2) a b (q + p) --Barton ________________________________ From: David Scherfgen via Maxima-discuss <max...@li...> Sent: Thursday, March 6, 2025 00:14 To: Richard Fateman <fa...@gm...> Cc: <max...@li...> <max...@li...> Subject: Re: [Maxima-discuss] makelist, map (and probably others) returning unsimplified lists -> extra simplifier calls Caution: Non-NU Email I gave a wrong number previously. The actual number of simplifier calls in the code that creates 100,000 list elements is 5 billion. $push doesn't cause resimplification of the entire list because it calls the simplifier with the second argument T. There's a comment in there by Barton: ;; We assume that if each member of a list is simplified, the list members are still simplified ;; after pushing onto (or popping) the list. Just before returning, the code calls simplifya ;; with second argument true. Without this call to simplifya, the general simplifier would simplify ;; every list member after returning. (Barton Willis, author of $push and $pop) $cons, $endcons and other functions should operate on the same assumption. I'm collecting all the affected functions to fix them. |