sign("foo") => Lisp error
I've fixed this by commit [ 5c1a91f ] which triggers a Maxima error for any atom which is not a number or symbol.
two new built-in functions, 'ordering' and 'ranks'
I'm not sure I would want to have 3 positional arguments, some of which might be false, although there is precedent for that elsewhere in Maxima if I recall correctly. Another possibility is a keyword argument key = ... which is not much used in Maxima, although much used in other systems such as Python. Yet another possibility is to distinguish the key from the order predicate is to inspect the supplied functions for the number of arguments, and look for one argument for the key versus two for the...
user-defined sorting order via key instead of predicate
feature request permutations and sort related features
I'm closing this ticket as "not a bug". Some workable solutions have been posted. If further discussion is needed, my advice is to bring it up on the maxima-discuss mailing list. Part of the discussion revolved around sorting on a subset of elements in a nested list. I think that is generally useful functionality, so I will open a ticket on the feature request ticket tracker (https://sourceforge.net/p/maxima/feature-requests/) for it.
About sorting by columns, here is a solution which makes use of the optional predicate argument of sort. I've separated the predicate into two parts, one to extract a key (something to compare) and the other to carry out the comparison. mykey (l) := [l[2], l[3]]; mypred (a, b) := orderlessp (mykey (a), mykey (b)); sort (L, mypred); where L is a nested list, with each element being a list of at least 3 elements. In the example above, mykey extracts the second and third elements of each element of...