You can subscribe to this list here.
2014 
_{Jan}

_{Feb}
(232) 
_{Mar}
(323) 
_{Apr}
(383) 
_{May}
(359) 
_{Jun}
(435) 
_{Jul}
(252) 
_{Aug}
(172) 
_{Sep}
(265) 
_{Oct}
(220) 
_{Nov}

_{Dec}


From: Pankaj Sejwal <pankajsejwal@gm...>  20140724 16:02:53

Hi, I wasn't aware of this but this is one good use case. I checked on Mathematica with {a=b,b=c,c=d}; Map[f,{a,b,c,d,e,f}]=> {f[d],f[d],f[d],f[d],f[e],f[f]} Maxima seems to treat it differently, map(f,[a,b,c,d]) => [f(b),f(c),f(d),f(e)] One more assignment is in between these two which "mapat" is doing. One interesting thing to note is, ll:[2,3,[a,b,[t,y,[u,i],[o,p],6,7]],8,8] then using list as input parameter gives double assignment, mapat([2,3,[a,b,[t,y,[u,i],[o,p],6,7]],8,8],[3,3,3],f) =>[2,3,[c,d,[t,y,f([u,i]),[o,p],6,7]],8,8] and for using list name instead, gives single assignment mapat(ll,[3,3,3],f) => [2,3,[b,c,[t,y,f([u,i]),[o,p],6,7]],8,8] Well, till now I always thought that using list or its name, mean the same thing. Now this kind of behaviour will prompt any user to try this, mapat('[2,3,[a,b,[t,y,[u,i],[o,p],6,7]],8,8],[3,3,3],f) => [2,3,[b,c,[t,y,f([u,i]),[o,p],6,7]],8,8] which is again single assignment. Hence a user can be made aware of these subtle points in its documentation. Few things I wanted to add to this function: There are some functions that are applied on all arguments all together(like 'matrix') and some that will be applied on list of arguments (like 'flatten', 'splice'). So 'mapat' needs two version depending on what user wants to do. Though user can make a separate function to make it work but its good if a variant can get things done. a) "mapat" with apply has been discussed, lets rename it to "map_apply_at", map_apply_at(ll,x,f):=block([],if(listp(apply(part,cons(ll,x)))) then apply(substinpart,cons('(apply(f,piece)),cons(ll,x))) else apply(substinpart,cons('(apply(f,[piece])),cons(ll,x))))$ If user wants to make multiple manipulations together, map_apply_at(ll,xx,f):=block([],for x in xx do (ll:if(listp(apply(part,cons(ll,x)))) then apply(substinpart,cons('(apply(f,piece)),cons(ll,x))) else apply(substinpart,cons('(apply(f,[piece])),cons(ll,x)))),ll)$ (%i3) map_apply_at(ll,[[3,3],[3]],f); (%o3) [2, 3, f(a, b, f(t, y, [u, i], [o, p], 6, 7)), 8, 8] If I consider multiple assignment problem here (%i6) (a:b,b:c,c:d,d:e); (%o6) e (%i7) map_apply_at([a,b,c,d,e],[[1]],f); (%o7) [f(c), d, e, e, e] (%i8) map_apply_at([a,b,c,d,e],[[1],[2]],f); (%o8) [f(d), f(e), e, e, e] (%i9) map_apply_at([a,b,c,d,e],[[1],[2],[3]],f); (%o9) [f(e), f(e), f(e), e, e With every increasing manipulation, assignment is also stepped by one. In Mathematica,for the same assignments MapAt[f,{a,b,c,d,e,f},1]=>{f[e],e,e,e,e,f} I think it is an advantage we have here with finer control. Of course, its advantageous or not could be debatable but again its just an opinion. b)Variant with application of function as "f([arg1,arg2...argn])". For multiple manipulations, map_f_at(ll,xx,f):=block([],for x in xx do (ll:if(listp(apply(part,cons(ll,x)))) then apply(substinpart,cons('(f(piece)),cons(ll,x))) else apply(substinpart,cons('(f(piece)),cons(ll,x)))),ll)$ (%i5) map_f_at(ll,[[3,3],[3]],ff); (%o5) [2, 3, ff([a, b, ff([t, y, [u, i], [o, p], 6, 7])]), 8, 8] This second variant can help in achieving one more feature of Mathematica, i.e. "FlattenAt". Flatten is supposed to flatten the entire list with no regard for inner sublists, but at times one needs to flatten only at some level & keep inner lists intact and appended to outer list(spliced) corresponding to its position(not in beginning or end) In maxima splice works only with buildq and has to be separately provided the list to be spliced. Using the above function, (%i2) map_f_at([2,3,4,[5,6,[u,[t],k],8],i,o],[4,3],splice); (%o2) [2, 3, 4, [5, 6, splice([u, [t], k]), 8], i, o] If it could be spliced, its done. We need a mechanism like "Sequence" in Mathematica. I tried using buildq but failed in my experiments. I shall be thankful if I could be provided with some suggestions.  Regards, Pankaj Sejwal ________________________________________________________ "The more I read, the more I acquire, the more certain I am that I know nothing.”  Voltaire 
From: Richard Fateman <fateman@be...>  20140724 15:17:00

(July 24, 2014) copy the directory http://www.cs.berkeley.edu/~fateman/lisp/mma4max I've mucked around with the MockMMA code from years ago. This code does a lot more than pattern matching (e.g. symbolic integration, rational simplification ....) but the part that is specifically being interfaced and described here with respect to Maxima is the pattern matcher. I'm assuming you know something of pattern matching in Mathematica. If not, the next few paragraphs will not make much sense. ............ From the README file This is a touchup for Maxima, GCL in particular, allowing what appears to be direct access to the pattern matching in MockMMA. Actually there is some translation to and from the MockMMA representation from Maxima. Until someone comes up with an alternative simple Maxima syntax for patterns like those in Mathematica, we will use the roughly equivalent FullForm style patterns. Though we use () instead of []. Thus Mathematica's _ is Blank() a_ is Pattern(a,Blank()) a__ is Pattern(a,BlankSequence()) a___ is Pattern(a,BlankNullSequence()) a_foo is Pattern(a,Blank(foo)) a?fooq is PatternTest(a,fooq) Now if you don't like to write these things explicitly you can, for example, write z:Pattern(a,BlankNullSequence()) and use z in patterns. There are a host of uses of patterns in Mathematica that we do not explicitly or implicitly support, e.g. member, subst, but which could be programmed. We can (already do) support in MockMMA the patternreplacement evaluation typical of Mathematica. However, this is in conflict with the usual Maxima evaluation process, and so the support here implicitly is for the Maxima user to convert the data into the mma format, mess around with it for a while with a different model of evaluation, and convert it back. Here's what we support "out of the box" here, as of July 24, 2014. A program sm (for simple match) sm(p,e,vars) is how it is called. p is a pattern e is an expression to be matched vars is a list of variables whose binding is of interest. sm(Pattern(aa,BlankSequence())+x, y+z+x,[aa]); returns [aa=z+y] sm(Cos(Pattern(a,Blank()))+Pattern(a,Blank()), x+Cos(x),[a]); returns [a=x] sm(Cos(Pattern(a,Blank()))+Pattern(b,Blank()), y+Cos(x)+z,[a,b]); returns [a=x,b=z+y] sm(Cos(Blank()),43,[]) returns false .......... the README file continues with installation instructions etc. I'm happy to receive comments. However, be alerted to the possibility that the bugs you find may be your "user errors" in designing patterns, rather than the pattern matching code itself. So look carefully. Not that the code is so perfectly written etc. Just that in my own personal experience, I'm far more likely to write a bad pattern than to newly discover a bug in the matching code. There is a file hey.batch with about 140 patterns in MockMMA syntax testing various features. And a whole bunch of other stuff after that to exercise MockMMA's general programming. None of this will work directly in Maxima because the syntax is not Maxima syntax. It is entirely possible to have Maxima read MockMMA syntax, e.g. (%i54) Convert2Maxima("a_+Cos[a_]") but then where do you go with that? Also there are sticky parts of the parsing program with respect to lowlevel input of characters.. it doesn't seem to work with wxmaxima but is ok in simpler modes. Maybe switching readtables is problem?? This stuff described here sm(p,e,vars) does not use the parser. RJF 
From: Henry Baker <hbaker1@pi...>  20140724 14:36:16

I'd like to match patterns for terms like a*b*B.C.X.Y.Z as: a*b  product of constants and scalars B.C  product of non"X" nonscalars X  the variable we're looking for Y.Z  product of non"X" nonscalars Need less to say, due to noncommutativity of ".", it gets more complicated to deal with multiple instances of non"X" nonscalars, scalars, etc. This is for solving quaternion algebraic equations. Thanks for any help. 
From: Barton Willis <willisb@un...>  20140724 12:22:53

Your code evaluates the input twice. This is nonstandard; examples: (%i2) (a:b,b:c,c:d,d:e,e:f)$ For mapat([a,b,c,d],[1],f), I would expect the result to be [f(b),c,d,e]. Instead: (%i3) mapat([a,b,c,d],[1],f); (%o3) [f(c),d,e,f] Compare this to (effectively solve b*c = d for b) (%i6) solve(a*b=c,a); (%o6) [b=d/c] Barton ________________________________ mapat(ll,x,f):=block([temp:[]],if(listp(apply(part,cons(ll,x)))) then apply(substinpart,cons('(apply(f,piece)),cons(ll,x))) else apply(substinpart,cons('(apply(f,[piece])),cons(ll,x))))$ ? 
From: Jaime Villate <villate@fe...>  20140724 10:01:34

On 23072014 19:46, Mario Rodriguez wrote: > El 23/07/14 a las #4, Gunter Königsmann escribió: >> draw2d(explicit(a*b,t,0,1)); >> > It should return an error message. I'll take a look at it and try to > figure out how to implement that, not only for 'explicit', but also for > all other graphic objects. > > Perhaps you can use listofvars to extract the variables in "a*b" and make sure that the expression given depends on two or less variables and that an interval has been specified for each of those variables. Regards, Jaime 
From: Gunter Königsmann <gunter@pe...>  20140723 21:35:28

Then loads of thanks to you in advance! Currently I'm outputting everything I plot to the console firstvi manually check if it is numeric  at least if my files needs more than a minute or so to reach the current point again. Any automatic function that allows me to skip this step would save me several minutes a day. Kind regards, Gunter. On 23. Juli 2014 20:46:50 MESZ, Mario Rodriguez <biomates@...> wrote: > >El 23/07/14 a las #4, Gunter Königsmann escribió: >> BEGIN PGP SIGNED MESSAGE >> Hash: SHA1 >> >> Got another thing that would make my life a little bit easier: >> >> load(draw); >> draw2d(explicit(a*b,t,0,1)); >> >> obviously cannot output a graph (assuming that a and b are undefined >> the result of the formula that is to plot will always be a symbol, >not >> a number) and draw will give up eventually. But this will need loads >> of time and result in a error message that doesn't tell what really >> happened: >> >> Maxima encountered a Lisp error: >> >> >>  : floating point overflow >> >> Automatically continuing. >> To enable the Lisp debugger set *debuggerhook* to nil. >> >> >> A test that catches this case might not be trivial, though: I assume >> it is possible for a formula to return symbolic results for some >point >> while being perfectly defined in others. >> >> >> Kind regards, >> >> Gunter. >> > >It should return an error message. I'll take a look at it and try to >figure out how to implement that, not only for 'explicit', but also for > >all other graphic objects. > >Thanks. > > >Mario > > >Want fast and easy access to all the code in your enterprise? Index and >search up to 200,000 lines of code with a free copy of Black Duck >Code Sight  the same software that powers the world's largest code >search on Ohloh, the Black Duck Open Hub! Try it now. >http://p.sf.net/sfu/bds >_______________________________________________ >Maximadiscuss mailing list >Maximadiscuss@... >https://lists.sourceforge.net/lists/listinfo/maximadiscuss  Diese Nachricht wurde von meinem Mobiltelefon mit Kaiten Mail gesendet. 
From: Edwin Woollett <woollett@ch...>  20140723 20:30:50

Project2: the Structure of a White Dwarf Star, is part of Chapter 2, Initial Value Problems, in the series Computational Physics Using R and Maxima, and has been posted on my web page. The code emphasizes the use of list arithmetic methods in Maxima (vector arithmetic methods in R). >From the web page http://www.csulb.edu/~woollett  Project 2: Structure of a White Dwarf Star NEW7/23/2014 A pedagogical discussion of the differential equations for the mass profile m(r) and the mass density profile rho(r), assuming the cold degenerate relativistic electron gas provides the internal pressure, and the nondegenerate heavy nuclei provide the gravitational attraction. Both R and Maxima code are used in parallel treatments to draw plots (for a given central density) of m(r), rho(r), kinetic energy profile k(r), gravitational energy profile u(r), and to explore the total energy (including rest mass energy) as a function of central mass density and the stellar mass, and to plot the stellar radius as a function of stellar mass. project2.pdf : Project 2, July 23, 2014, Maxima 5.31.2, R 3.0.2, 27 pages project2.tex : Project 2 Latex code file, July 23, 2014 project2.R : R code for Project 2, July 23, 2014, R 3.0.2 project2.mac : Maxima code for Project 2 , July 23, 2014, Maxima 5.31 project2.zip : zip file contains all files for Project 2, July 23, 2014  Ted Woollett 
From: Mario Rodriguez <biomates@te...>  20140723 18:47:00

El 23/07/14 a las #4, Gunter Königsmann escribió: > BEGIN PGP SIGNED MESSAGE > Hash: SHA1 > > Got another thing that would make my life a little bit easier: > > load(draw); > draw2d(explicit(a*b,t,0,1)); > > obviously cannot output a graph (assuming that a and b are undefined > the result of the formula that is to plot will always be a symbol, not > a number) and draw will give up eventually. But this will need loads > of time and result in a error message that doesn't tell what really > happened: > > Maxima encountered a Lisp error: > > >  : floating point overflow > > Automatically continuing. > To enable the Lisp debugger set *debuggerhook* to nil. > > > A test that catches this case might not be trivial, though: I assume > it is possible for a formula to return symbolic results for some point > while being perfectly defined in others. > > > Kind regards, > > Gunter. > It should return an error message. I'll take a look at it and try to figure out how to implement that, not only for 'explicit', but also for all other graphic objects. Thanks.  Mario 
From: Raymond Toy <toy.raymond@gm...>  20140723 18:13:09

>>>>> "Stavros" == Stavros Macrakis <(Σταῦρος Μακράκης)" <macrakis@...>> writes: Stavros> Anyone who's using ?xxx() calls is using the underlying Stavros> Lisp, and it's not up to us to protect them. Stavros> If the operation is useful to Maxima users, it should be Stavros> exposed as a Maxima function with appropriate error Stavros> checking and reporting. Indeed. I dislike that integrate(x) gives you a Lisp error. But I like that quad_qags(x) gives a nice error message: Too few arguments supplied to quad_qags(fun, var, a, b, [epsrel, limit, epsabs]): found [x] I think I proposed long ago to modify defmfun to do more checking. I think people were opposed because it might slow down maxima too much. I never implemented it so we don't actually know if that is true or not. Ray 
From: Pankaj Sejwal <pankajsejwal@gm...>  20140723 15:20:36

Hi, I noticed this behavior first on Mathematica and it just stayed on my mind. In maxima, I meant "a:b". I am sorry I didn't mention it clearly and wrote from the perspective of a Mathematica user.I am thankful for your advice and I should remember it. On Wed, Jul 23, 2014 at 7:59 PM, Stavros Macrakis (Σταῦρος Μακράκης) < macrakis@...> wrote: > In Maxima, a=b is not an assignment. It is an equation. There are several > contexts in which this equation can be used to indicate that a corresponds > to b: > > subst(a=b,...) means "substitute b for a in ..." > ev(...,a=b) means "evaluate ... with a temporarily having the value b" > ...,a=b on an input line is a shorthand for ev(...,a=b) > > I *strongly recommend against using *ev. It has messy semantics, and in > particular shouldn't be used when programming. Subst has much cleaner and > simpler semantics. > > s >  Regards, Pankaj Sejwal _____________________________________________________________________ "The more I read, the more I acquire, the more certain I am that I know nothing.”  Voltaire 
From: Stavros Macrakis (Σταῦρος Μακράκης) <macrakis@al...>  20140723 14:29:26

In Maxima, a=b is not an assignment. It is an equation. There are several contexts in which this equation can be used to indicate that a corresponds to b: subst(a=b,...) means "substitute b for a in ..." ev(...,a=b) means "evaluate ... with a temporarily having the value b" ...,a=b on an input line is a shorthand for ev(...,a=b) I *strongly recommend against using *ev. It has messy semantics, and in particular shouldn't be used when programming. Subst has much cleaner and simpler semantics. s On Wed, Jul 23, 2014 at 8:31 AM, Pankaj Sejwal <pankajsejwal@...> wrote: > Hi, > Some time back when I was working on finding inverse of row reduction > using equations solving(in which thankfully you shared your views) > I noticed that systems(both maxima and Mathematica) work with assignments > as, a=b, b=c then a=c. So at the end of solve if I am > expecting 'a' to give 'b' as I presume a=b, then I will be wrong(though > right !) as it will solve it further to give a=c and > this looks completely harmless until one needs a solution without last > minute assignments which the algo I proposed utterly depends on. > > For some time I thought CAS must maintain separate context for LHS and RHS > variables even if they are same, but realized that even if > achieved it will complicate the matter as in subsequent solutions it will > become difficult to tell LHS variables from RHS ones. > > Clearly something like this is happening here where f=x,x=[1] hence f=[1]. > One obvious temporary fix for now might be using really odd names > as function arguments. I tried few things but couldn't prevent this > assignment,I am not certain if this has a fix but if there is, > I am keen to know it. > > > > On Tue, Jul 22, 2014 at 4:09 PM, Barton Willis <willisb@...> wrote: > >> >> 1. The local variable temp is unused. >> >> 2. Maybe your code should pair substpart with part or pair >> substinpart with inpart. >> >> 3. I do not know of a simple and foolproof cure for >> >> (%i3) mapat(a+b,[1], x); >> apply: found x evaluates to [1] where a function was expected. >> >> (%i5) mapat(a+b,[1],xx); >> (%o5) b+xx(a) >> >> Barton >> >> >> >>  >> >> >> mapat(ll,x,f):=block([temp:[]],if(listp(apply(part,cons(ll,x)))) >> then >> apply(substinpart,cons('(apply(f,piece)),cons(ll,x))) >> else >> apply(substinpart,cons('(apply(f,[piece])),cons(ll,x))))$ >> >> >> > > > >  > Regards, > Pankaj Sejwal > _____________________________________________________________________ > "The more I read, the more I acquire, the more certain I am that I know > nothing.”  > Voltaire > > >  > Want fast and easy access to all the code in your enterprise? Index and > search up to 200,000 lines of code with a free copy of Black Duck > Code Sight  the same software that powers the world's largest code > search on Ohloh, the Black Duck Open Hub! Try it now. > http://p.sf.net/sfu/bds > _______________________________________________ > Maximadiscuss mailing list > Maximadiscuss@... > https://lists.sourceforge.net/lists/listinfo/maximadiscuss > > 
From: Pankaj Sejwal <pankajsejwal@gm...>  20140723 12:32:14

Hi, Some time back when I was working on finding inverse of row reduction using equations solving(in which thankfully you shared your views) I noticed that systems(both maxima and Mathematica) work with assignments as, a=b, b=c then a=c. So at the end of solve if I am expecting 'a' to give 'b' as I presume a=b, then I will be wrong(though right !) as it will solve it further to give a=c and this looks completely harmless until one needs a solution without last minute assignments which the algo I proposed utterly depends on. For some time I thought CAS must maintain separate context for LHS and RHS variables even if they are same, but realized that even if achieved it will complicate the matter as in subsequent solutions it will become difficult to tell LHS variables from RHS ones. Clearly something like this is happening here where f=x,x=[1] hence f=[1]. One obvious temporary fix for now might be using really odd names as function arguments. I tried few things but couldn't prevent this assignment,I am not certain if this has a fix but if there is, I am keen to know it. On Tue, Jul 22, 2014 at 4:09 PM, Barton Willis <willisb@...> wrote: > > 1. The local variable temp is unused. > > 2. Maybe your code should pair substpart with part or pair > substinpart with inpart. > > 3. I do not know of a simple and foolproof cure for > > (%i3) mapat(a+b,[1], x); > apply: found x evaluates to [1] where a function was expected. > > (%i5) mapat(a+b,[1],xx); > (%o5) b+xx(a) > > Barton > > > >  > > > mapat(ll,x,f):=block([temp:[]],if(listp(apply(part,cons(ll,x)))) > then > apply(substinpart,cons('(apply(f,piece)),cons(ll,x))) > else > apply(substinpart,cons('(apply(f,[piece])),cons(ll,x))))$ > > >  Regards, Pankaj Sejwal _____________________________________________________________________ "The more I read, the more I acquire, the more certain I am that I know nothing.”  Voltaire 
From: Gunter Königsmann <gunter@pe...>  20140723 05:25:43

BEGIN PGP SIGNED MESSAGE Hash: SHA1 Got another thing that would make my life a little bit easier: load(draw); draw2d(explicit(a*b,t,0,1)); obviously cannot output a graph (assuming that a and b are undefined the result of the formula that is to plot will always be a symbol, not a number) and draw will give up eventually. But this will need loads of time and result in a error message that doesn't tell what really happened: Maxima encountered a Lisp error:  : floating point overflow Automatically continuing. To enable the Lisp debugger set *debuggerhook* to nil. A test that catches this case might not be trivial, though: I assume it is possible for a formula to return symbolic results for some point while being perfectly defined in others. Kind regards, Gunter. On 14.07.2014 08:15, Pankaj Sejwal wrote: > stavros old > message >> ?I have started a page on the Sourceforge wiki, ?Proposed work >> areas >> <https://sourceforge.net/p/maxima/wiki/Proposed%20work%20areas/>;. >> >> >> Toplevel ideas belong on that page, and more detailed thoughts on the >> pages it points to. >>  > >> I would like to suggest few additions to it if I may. > a) We are lacking solving "inequalities" which are obviously > fundamental to every aspect of math. b) We shall also suggest names > of algorithms that can help in getting better methods. Finder will > certainly end up searching what he needs, but a small list of > algorithms could help more. c)Few pages of developer doc will also > be a great help as we can find in most of the well flourished open > source projects. d) There could be one common directory there in > which anyone who is writing experimental code in Maxima, can share > docs/pdf of his research or good papers in a responsible way. > BEGIN PGP SIGNATURE Version: GnuPG v1 Comment: Using GnuPG with Thunderbird  http://www.enigmail.net/ iQIcBAEBAgAGBQJTz0dIAAoJEFyGwOQhHVuO/hgP/jHbX9zRusvbb6TKNbyTa67b F2/rOyrS3NkKMuMczQOjq5vZtqMj4Y1xcFyrc60ibGAYiruY+8nTVJOKEp3JjMA+ tZXUiu2U8egtUgSCjlGBYTWr2hmOTkrU98zLMfqUPsxpHc/pEWkZYPmRjrkMFJg0 FUWMvNPWMtkkIHknKmz4yXF1c7PqR4w+CXkLiVV/Ea7edgUWQUPHQg5cOu/hVRCp otjeQVaS/6j5uxqaFjCHeXWU1pzEWDKs11QLL1L5FbeYO2YzETgYci/pf7M1mo9E fqcdtgnIA6pNzugn/Q1kOX11updr+RHGdnhMkbxK6bhl91LFsCYac5jD2SXX3APl 7n2XxJgigj0kD5OCgVQygrvl7SvBzRZXRBpeCyPX0K2SO2fyc37+5xmnwkjkw90S oAX87CyaCE0LiiWemVRYH3RsnOx/1AL1BhMSMf5VRiXgdT1uMqVhzEHrXulOPxAJ QeB9WTowVh9cp81FC06Rm49N1nC8hn5t4vNYzQ/GGxlYoZk0tJClUa9qGtTFaGRA yLfCfQEjjyKeshjLboq5e00ZajDZEfFdARPW0qu+ImbtZ8e3eA/sjSaptPRMA7Xc wYhEqUYpGHQw5iS9GKBNKIce4oodDXJyCKbfCCfQ0Nnik8tsBv5r39lZaJtLLz2B ob9j0i/ImbaGCsW2zGNR =0EDD END PGP SIGNATURE 
From: Richard Fateman <fateman@be...>  20140722 14:49:07

On 7/22/2014 7:38 AM, Dimiter Prodanov wrote: > Dear all, > > It is not necessary to check for all possible types of arguments but > if a function expects a 'list' as an argument then if the argument is > not a list the function should exit gracefully i.e. by an exception > or by returning an indefinite value. > This is just some standard practice in Java, Python, C# etc. yes, you are perfectly right that one can add a check in map() for a list. Alternatively one could define another kind of answer. For example, map(f,3) could return unevaluated as map(f,3) instead of an error. map(f,1/2) could return f(1)/f(2), instead of an error note that map(f,a+b) already returns f(b)+f(a), so the program has been generalized beyond just "list". Isn't Maxima fun? RJF 
From: Dimiter Prodanov <dimiterpp@gm...>  20140722 14:39:24

Dear all, It is not necessary to check for all possible types of arguments but if a function expects a 'list' as an argument then if the argument is not a list the function should exit gracefully i.e. by an exception or by returning an indefinite value. This is just some standard practice in Java, Python, C# etc. best regards, Dimiter 
From: Stavros Macrakis (Σταῦρος Μακράκης) <macrakis@al...>  20140722 13:46:59

Anyone who's using ?xxx() calls is using the underlying Lisp, and it's not up to us to protect them. If the operation is useful to Maxima users, it should be exposed as a Maxima function with appropriate error checking and reporting. s On Tue, Jul 22, 2014 at 9:42 AM, Richard Fateman <fateman@...> wrote: > On 7/22/2014 5:46 AM, Stavros Macrakis (Σταῦρος Μακράκης) wrote: > >> >> Checking arguments is cheap compared to most of what Maxima does. There's >> no good reason not to check. >> >> Well, I agree that it could be low cost in time to check just Maxima > commands. (no ?cons etc). > It is sometimes a touchy issue as to whether a command is potentially > valid. Is tan(%pi/2) invalid or valid with return value "und"? Anyway.. > > Conceptually I see a huge table (or it could be organized hierarchically > by some objectoriented mechanism) > that looks like this: > > "Type" > list integer float bigfloat rational string symbol > numeric equation plus times rat poisson :) ... etc > > Location in code >  > arg1 to solve > arg2 to solve > > arg1 to integrate > arg2 to integrate > arg3 to integrate > arg4 to integrate > > arg1 to ?cons > arg2 to ?cons > > > etc for thousands of lines. > > > As for the "memory may be damaged" errors, that is overly dramatic. >> Maxima doesn't do many rplacx operations. And I hope we're not using Lisp >> implementations where stack overflow can corrupt other data structures. >> >> I have always ignored the "memory may be damaged" and continued > computing. > RJF > > > 
From: Richard Fateman <fateman@be...>  20140722 13:42:55

On 7/22/2014 5:46 AM, Stavros Macrakis (Σταῦρος Μακράκης) wrote: > > Checking arguments is cheap compared to most of what Maxima does. > There's no good reason not to check. > Well, I agree that it could be low cost in time to check just Maxima commands. (no ?cons etc). It is sometimes a touchy issue as to whether a command is potentially valid. Is tan(%pi/2) invalid or valid with return value "und"? Anyway.. Conceptually I see a huge table (or it could be organized hierarchically by some objectoriented mechanism) that looks like this: "Type" > list integer float bigfloat rational string symbol numeric equation plus times rat poisson :) ... etc Location in code  arg1 to solve arg2 to solve arg1 to integrate arg2 to integrate arg3 to integrate arg4 to integrate arg1 to ?cons arg2 to ?cons etc for thousands of lines. > As for the "memory may be damaged" errors, that is overly dramatic. > Maxima doesn't do many rplacx operations. And I hope we're not using > Lisp implementations where stack overflow can corrupt other data > structures. > I have always ignored the "memory may be damaged" and continued computing. RJF 
From: Stavros Macrakis (Σταῦρος Μακράκης) <macrakis@al...>  20140722 12:46:17

Checking arguments is cheap compared to most of what Maxima does. There's no good reason not to check. As for the "memory may be damaged" errors, that is overly dramatic. Maxima doesn't do many rplacx operations. And I hope we're not using Lisp implementations where stack overflow can corrupt other data structures. s On Jul 21, 2014 1:06 PM, "Raymond Toy" <toy.raymond@...> wrote: > >>>>> "Richard" == Richard Fateman <fateman@...> writes: > > Richard> Any Lisp function can be called on any Lisp object from > Maxima. > Richard> Intercepting all possible illegal operations in Lisp would be > a > Richard> challenge. You can type, in Maxima, > Richard> ?+(3,4) to get 7 > Richard> ?+(3,x) to get a Lisp error. (although not "memory may be > damaged"...) > Richard> It would of course be nice to never get an error message > Richard> from Lisp, but get a more appropriate error message from > Richard> Maxima. But a challenge, since Maxima has almost nothing > Richard> to do with the execution of a Lisp function xxx called > Richard> as ?xxxx(.....) > > I think if you're going to use Lisp functions using ?, then you get > Lisp behavior, including lisp errors. > > I find it unfortunate that Maxima functions can cause errors like > "memory may by damaged" on bad input, especially if memory is actually > damaged. > > Checking for bad inputs is one way to avoid this, but the check is not > free and might slow down maxima too much. I don't have an answer for > that. > > Ray > > > >  > Want fast and easy access to all the code in your enterprise? Index and > search up to 200,000 lines of code with a free copy of Black Duck > Code Sight  the same software that powers the world's largest code > search on Ohloh, the Black Duck Open Hub! Try it now. > http://p.sf.net/sfu/bds > _______________________________________________ > Maximadiscuss mailing list > Maximadiscuss@... > https://lists.sourceforge.net/lists/listinfo/maximadiscuss > 
From: Barton Willis <willisb@un...>  20140722 10:39:19

1. The local variable temp is unused. 2. Maybe your code should pair substpart with part or pair substinpart with inpart. 3. I do not know of a simple and foolproof cure for (%i3) mapat(a+b,[1], x); apply: found x evaluates to [1] where a function was expected. (%i5) mapat(a+b,[1],xx); (%o5) b+xx(a) Barton ________________________________ mapat(ll,x,f):=block([temp:[]],if(listp(apply(part,cons(ll,x)))) then apply(substinpart,cons('(apply(f,piece)),cons(ll,x))) else apply(substinpart,cons('(apply(f,[piece])),cons(ll,x))))$ ? 
From: Jaime Villate <villate@fe...>  20140722 10:16:04

On 21072014 18:07, Camm Maguire wrote: > Greetings! I have the following issue with the Debian maxima package: > > E: maximadoc: privacybreachlogo usr/share/doc/maximadoc/html/maxima.htmlhttp://maxima.sourceforge.net/favicon.ico > N: > N: This package creates a potential privacy breach by fetching a logo at > N: runtime. Hi Camm, I have just committed a fix that adds a local copy of favicon.ico in the subdirectory doc/info/figures and uses it instead of http://maxima.sourceforge.net/favicon.ico. In any case, I will also recover http://maxima.sourceforge.net/favicon.ico which has vanished. I'm glad to see that you are working on the Debian package. While we are on the subject, do you see any chance of creating also a package with Maxima+SBCL? Or would you rather have someone else create such package? Regards, Jaime 
From: Camm Maguire <camm@ma...>  20140721 17:08:11

Greetings! I have the following issue with the Debian maxima package: E: maximadoc: privacybreachlogo usr/share/doc/maximadoc/html/maxima.html http://maxima.sourceforge.net/favicon.ico N: N: This package creates a potential privacy breach by fetching a logo at N: runtime. N: N: Before using a local copy you should check that the logo is suitable N: for main. You can get help with determining this by posting a link to N: the logo and a copy of, or a link to, the logo copyright and license N: information to the debianlegal mailing list. N: N: Please replace any scripts, images, or other remote resources with N: nonremote resources. It is preferable to replace them with text and N: links but local copies of the remote resources are also acceptable as N: long as they don't also make calls to remote services. Please ensure N: that the remote resources are suitable for Debian main before making N: local copies of them. N: N: Severity: serious, Certainty: possible N: N: Check: files, Type: binary, udeb N: E: maximadoc: privacybreachlogo usr/share/doc/maximadoc/html/maxima_1.html http://maxima.sourceforge.net/favicon.ico E: maximadoc: privacybreachlogo usr/share/doc/maximadoc/html/maxima_10.html http://maxima.sourceforge.net/favicon.ico E: maximadoc: privacybreachlogo usr/share/doc/maximadoc/html/maxima_11.html http://maxima.sourceforge.net/favicon.ico ... Furthermore, http://maxima.sourceforge.net/favicon.ico does not exist. I tried briefly moving the texi2html init file out of the way, but have not succeeded in eliminating these references yet. Suggestions? Take care,  Camm Maguire camm@... ========================================================================== "The earth is but one country, and mankind its citizens."  Baha'u'llah 
From: Raymond Toy <toy.raymond@gm...>  20140721 17:06:06

>>>>> "Richard" == Richard Fateman <fateman@...> writes: Richard> Any Lisp function can be called on any Lisp object from Maxima. Richard> Intercepting all possible illegal operations in Lisp would be a Richard> challenge. You can type, in Maxima, Richard> ?+(3,4) to get 7 Richard> ?+(3,x) to get a Lisp error. (although not "memory may be damaged"...) Richard> It would of course be nice to never get an error message Richard> from Lisp, but get a more appropriate error message from Richard> Maxima. But a challenge, since Maxima has almost nothing Richard> to do with the execution of a Lisp function xxx called Richard> as ?xxxx(.....) I think if you're going to use Lisp functions using ?, then you get Lisp behavior, including lisp errors. I find it unfortunate that Maxima functions can cause errors like "memory may by damaged" on bad input, especially if memory is actually damaged. Checking for bad inputs is one way to avoid this, but the check is not free and might slow down maxima too much. I don't have an answer for that. Ray 
From: Pankaj Sejwal <pankajsejwal@gm...>  20140721 16:11:49

Hi, Initially I couldn't figure out why you were getting error until I restarted Maxima and figured out that it was possibly side effect of some other expression that somehow my function was working as expected(I couldn't figure out why though ! and its strange too). I tried to fix it again and checked with Maxima restarted multiple times. I have tried to make it compatible to both list and atom on asked position. I thought what if I defer the evaluation of apply till piece get its value, and I think before leaving the function Maxima does a final evaluation. ll:[2,3,[a,b,[t,y,[u,i],[o,p],6,7]],8,8]; mapat(ll,x,f):=block([temp:[]],if(listp(apply(part,cons(ll,x)))) then apply(substinpart,cons('(apply(f,piece)),cons(ll,x))) else apply(substinpart,cons('(apply(f,[piece])),cons(ll,x))))$ mapat(ll,[3,3,3,1],pluto); [2,3,[a,b,[t,y,[pluto(u),i],[o,p],6,7]],8,8] mapat(ll,[3,3,3],pluto); [2,3,[a,b,[t,y,pluto(u,i),[o,p],6,7]],8,8] two_args(x,y):=x+y$ mapat(ll,[3,3,3],two_args); [2,3,[a,b,[t,y,u+i,[o,p],6,7]],8,8] mapat(ll,[3,3,3,1],sqrt); [2,3,[a,b,[t,y,[sqrt(u),i],[o,p],6,7]],8,8] Please try once and share your views. On Mon, Jul 21, 2014 at 7:47 PM, Barton Willis <willisb@...> wrote: > Your code is broken: > > > (%i1) ex(ll,x,f) := > apply(substinpart,cons(apply(f,piece),cons(ll,x)))$ > (%i2) ll:[2,3,[a,b,[t,y,[u,i],[o,p],6,7]],8,8]$ > > > (%i3) ex(ll,[3,3,4],fun); > apply: second argument must be a list; found: piece > > > The error message is reasonably clear. The assignment to `piece' is a > side effect of the function substinpart. When > > the inner apply is called, piece doesn't have the correct value. Fixing > your code will be a fun puzzle. > > > Barton > >  Regards, Pankaj Sejwal _______________________________________________ "The more I read, the more I acquire, the more certain I am that I know nothing.”  Voltaire 
From: Barton Willis <willisb@un...>  20140721 14:18:10

Your code is broken: (%i1) ex(ll,x,f) := apply(substinpart,cons(apply(f,piece),cons(ll,x)))$ (%i2) ll:[2,3,[a,b,[t,y,[u,i],[o,p],6,7]],8,8]$ (%i3) ex(ll,[3,3,4],fun); apply: second argument must be a list; found: piece The error message is reasonably clear. The assignment to `piece' is a side effect of the function substinpart. When the inner apply is called, piece doesn't have the correct value. Fixing your code will be a fun puzzle. Barton ________________________________ From: Pankaj Sejwal <pankajsejwal@...> Sent: Monday, July 21, 2014 08:05 To: Barton Willis; maximadiscuss@...; Stavros Macrakis Subject: Re: [Maximadiscuss] convert list access to function Hi, Using Barton's suggestion I fixed it as, ex(ll,x,f):=apply(substinpart,cons(apply(f,piece),cons(ll,x)))$ ex(ll,[3,3,4],fun) => [2,3,[a,b,[t,y,[u,i],fun(o,p),6,7]],8,8] With this now one can get functionality similar to Mathematica's "MapAt" feature. I am thankful to provided suggestions and help. ?>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>? On Mon, Jul 21, 2014 at 4:59 PM, Barton Willis <willisb@...<mailto:willisb@...>> wrote: Try using either inpart or substinpart; example (%i12) substinpart(apply(f,piece), ll, 3,3,3); (%o12) [2,3,[a,b,[t,y,f(u,i),[o,p],6,7]],8,8] bw ________________________________________ I want to access list elements based on their position but I don't intend to extract the elements out of list but instead keep my curosr there to apply some function on it, say, ll:[2,3,[a,b,[t,y,[u,i],[o,p],6,7]],8,8] I can reachout to various elements using, a) Using substitution, subst(apply(f,ll[3][3][3]),ll[3][3][3],ll) b) Or using positions directly as, ll[3][3][4]:apply(f,ll[3][3][4]); Showing the combined result of above two expressions, ll now, [2,3,[a,b,[t,y,f(u,i),f(o,p),6,7]],8,8] I want to create a function say, map_at_position(ll,[3,3,4],f) that shall give me [2,3,[a,b,[t,y,[u,i],f(o,p),6,7]],8,8] Function definition needs to be like, map_at_position(ll,a,f):=block([],ll[a1][a2]a[3]...[an]:apply(f,ll[a1],[a2],[a3]...[an]),ll) where a = [a1,a2,a3...an] representing the positions I am not able to figure out how to convert [3,3,3] to ll[3][3][3] kind of expression. I mean there can't be consed/joined/appended etc without comma.   Regards, Pankaj Sejwal _______________________________________________ "The more I read, the more I acquire, the more certain I am that I know nothing."  Voltaire<http://www.goodreads.com/author/show/5754446.Voltaire>; 
From: Vlad <imbvlad@gm...>  20140721 13:35:44

I am sorry for the late response but I was expecting to see the replies in GMail (I didn't subscribe). Today, seeing a lack of answer, still, I thought I'd search Google for "draw2d segfault", and thank goodness I did: I found the thread on news.gmane.org. I can't reply there so, my apologies for any inconvenience, I'll reply to my OP. I hope this doesn't ruin your lists; if it does, say so. Tomorrow I'll search Google again and, if needed, I'll subscribe. In the meantime, the reply from Gunter Königsmann (below) did the trick. first time I loaded "draw", it recompiled all the files then it was ready to go. It also seems faster now. Thank you. > A very long shot would be that the segfault is caused > by using a version of draw that was compiled at the first > use when the system still contained a different lisp than > it does now. > Perhaps it is worth trying to delete the respective files in > the .maxima folder inside your home folder. But don't > delete the directories you'll find there, as well. Vlad ______________________ ltspicegoodies.ltwiki.org  holding, among others: a universal analog/digital filter, blocklevel models for power electronics (and not only), math blocks with a more streamlined approach, some digital ADC, DAC, (synchronous)counter, JKflop, etc. 