What's wrong with telling people to use 'makelist(k,k,1,5)?
I'm not really keen on hacking on things so that simp:false will work in some specific cases. (But I never turn that off, so I'm not a good judge on what simp:false should or should not do.)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Sorry, I should have explained the use-case more clearly. The goal is to create un-simplified objects, e.g. for the student to simplify themselves.
We use simp:false all the time when using Maxima for online assessment. I appreciate that's unusual to CAS users who always want the answer to a calculation!
'makelist(k,k,1,5) returns the makelist unevaluated. We would like things like
makelist(ev(k,simp)+2,k,1,5) to return [1+2,2+2,3+2,4+2,5+2]. The only reason makelist currently fails is because the error trapping does not recognize the un-simplified numbers.
We're not proposing simp:falsewill work in some specific cases, rather we'd like comprehensive support for simp:false. This particular example (with makelist) comes up a lot. Our long-standing work around is to use something like
which is rather artificial! I hope this makes sense.
(For anyone new to STACK, which uses Maxima, the project website is herehttps://stack-assessment.org/ The Maxima community would be very welcome at one of our conferences or meetings. Thanks for Maxima, it's great. I'm making this suggestion as a genuine improvement).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I agree with Ray about simp:false. Besides, Maxima provides a more powerful way to deal with this problem: noun operators. For example, I want to produce a list of (unsimplified) squares:
This is, I think, a much more robust way to deal with the problem of generating "unsimplified" expressions. Too much of Maxima's capabilities cease to function when the simplifier is turned off. I don't think this is a bug, because Maxima provides a means to create unsimplified or partially simplified expressions even when the simplifier is on.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I say incidental because it doesn't handle the general symbolic case,
where the termination condition requires symbolic comparisons. But I don't
think anyone needs or wants that case (in any case is is very weak).
Is it reasonable to bind simp to t while evaluating incrementation and
termination? I guess it doesn't interfere with the usual reasons that
people use simp:false.
I agree with Ray about simp:false. Besides, Maxima provides a more
powerful way to deal with this problem: noun operators. For example, I want
to produce a list of (unsimplified) squares:
l : makelist(Exp(k,2),k,1,5);lsimp : subst(Exp="^",l);
This is, I think, a much more robust way to deal with the problem of
generating "unsimplified" expressions. Too much of Maxima's capabilities
cease to function when the simplifier is turned off. I don't think this is
a bug, because Maxima provides a means to create unsimplified or partially
simplified expressions even when the simplifier is on.
I think this should be fairly simple to fix, by "simplifying" the numbers before testing. I'm suggesting we don't go as far as using this.
If you want the values of the variables simplified, you can always use
makelist(ev(k,simp)^2,k,1,4);I've proposed a fix here: https://sourceforge.net/u/sangwincsf/maxima/ci/0bd4236f66994f5cf2191be693fa4154e511f5d7
Last edit: Christopher Sangwin 2026-03-31
What's wrong with telling people to use
'makelist(k,k,1,5)?I'm not really keen on hacking on things so that
simp:falsewill work in some specific cases. (But I never turn that off, so I'm not a good judge on whatsimp:falseshould or should not do.)Sorry, I should have explained the use-case more clearly. The goal is to create un-simplified objects, e.g. for the student to simplify themselves.
We use
simp:falseall the time when using Maxima for online assessment. I appreciate that's unusual to CAS users who always want the answer to a calculation!'makelist(k,k,1,5)returns themakelistunevaluated. We would like things likemakelist(ev(k,simp)+2,k,1,5)to return[1+2,2+2,3+2,4+2,5+2]. The only reasonmakelistcurrently fails is because the error trapping does not recognize the un-simplified numbers.We're not proposing
simp:falsewill work in some specific cases, rather we'd like comprehensive support forsimp:false. This particular example (withmakelist) comes up a lot. Our long-standing work around is to use something likemap(lambda([ex], ex+2), ev(makelist(k,k,1,5),simp))which is rather artificial! I hope this makes sense.
(For anyone new to STACK, which uses Maxima, the project website is herehttps://stack-assessment.org/ The Maxima community would be very welcome at one of our conferences or meetings. Thanks for Maxima, it's great. I'm making this suggestion as a genuine improvement).
Following my post below, the easy and natural way to make your example work is like this:
and then
We can define more complicated simplifiers for the
Plusoperator (or analogues), butsubstwill work 99% of the time for the problems in STACK.And, if your users prefer an infix operator instead of the prefix operator
Plus, that is no problem:For example,
```
(%i20) l : makelist(k ⨹ 2 ⨹ Exp(k,3),k,1,5);
(%o20) [(1 ⨹ 2) ⨹ Exp(1, 3), (2 ⨹ 2) ⨹ Exp(2, 3), (3 ⨹ 2) ⨹ Exp(3, 3),
(4 ⨹ 2) ⨹ Exp(4, 3), (5 ⨹ 2) ⨹ Exp(5, 3)]
(%i21) tex(l);
$$\left[ 1+2+{1}^{3} , 2+2+{2}^{3} , 3+2+{3}^{3} , 4+2+{4}^{3} , 5+2+{5}^{3}
\right] $$
(%i22) lsimp : subst(["⨹"="+", Exp="^"], l);
(%o22) [4, 12, 32, 70, 132]
```
I agree with Ray about
simp:false. Besides, Maxima provides a more powerful way to deal with this problem: noun operators. For example, I want to produce a list of (unsimplified) squares:In 1d display:
If I want to make the display look nice in TeX, I can add a printer for TeX:
and then
This is, I think, a much more robust way to deal with the problem of generating "unsimplified" expressions. Too much of Maxima's capabilities cease to function when the simplifier is turned off. I don't think this is a bug, because Maxima provides a means to create unsimplified or partially simplified expressions even when the simplifier is on.
makelist uses the simplifier to perform arithmetic in order to cover all
kinds of number, e.g.,
makelist(i,i,2/3,5.0b0) => [2/3,5/3,8/3,11/3,14/3]
makelist(i,i,-2.1b0,0,7/8) => [-2.1b0, -1.225b0, -3.5b-1]
As an incidental bonus, it handles some non-numeric cases:
makelist(i,i,n,n+2) => [n, n+1, n+2]
makelist(i,i,sqrt(%e),%pi) => [sqrt(%e), sqrt(%e)+1]
I say incidental because it doesn't handle the general symbolic case,
where the termination condition requires symbolic comparisons. But I don't
think anyone needs or wants that case (in any case is is very weak).
Is it reasonable to bind simp to t while evaluating incrementation and
termination? I guess it doesn't interfere with the usual reasons that
people use simp:false.
On Tue, Mar 31, 2026 at 12:12 PM Leo Butler via Maxima-bugs maxima-bugs@lists.sourceforge.net wrote:
Related
Bugs: #4693