John Fredsted

2238 Reputation

15 Badges

20 years, 164 days

MaplePrimes Activity


These are Posts that have been published by John Fredsted

On the ground of problems with tab indentation, see my former thread, I now instead use spaces as indentation (as I suppose the majority of you do too, or what?) Using spaces comes at a price, though: Each indentation of mine consists of three spaces. For deeper nested/indented structures of code these, I think, becomes quite tedious to enter. Therefore, the following question: When using Shift + Enter, that is, creating a new line, is there some way to tweak Maple to automatically position the curs
Consider, just a test example, the following list of lists of positive integers ordered ascendingly
L := [[1,2,7,12],[3,4,5,6],[1,2,5,9]];
I would like this list of lists ordered so that [1,2,5,9] precedes [1,2,7,12], because 5 < 7 (the first two elements being equal), and [1,2,7,12] precedes [3,4,5,6], because 1 < 3. I think you see the general scheme. That can be achieved with the following code:
with(ListTools):
swapLists := proc(L1::'list'(posint),L2::'list'(posint))
   local L;
   L := MakeUnique(L1-L2);
   if L = [0] then
      false
   elif L[1] <> 0 then
In connection with setting attributes on Arrays, as discussed here, I have run into a problem which boils down to the following: why does the code (which is only for test purposes)
p1 := proc(x,y)
   table(['x' = x,'y' = y])
end proc:
p2 := proc()
   local x,y;
   x,y := 1,2;
   table(['x' = x,'y' = y])
end proc:
p1(1,2);
p2();
produce two different outputs; the former, p1, evaluates 'x' and 'y', even though they are surrounded by unevaluation quotes, while the latter, p2, does not?
Why is it not possible to edit the root-post of a thread before anyone has replied to it? I ask, of course, because sometimes, despite proofreading, I overlook typos or bad grammar (being Danish, the latter is quite often a bit difficult to avoid), or because I simply want to add additional material that comes to mind after having posted.
In the column "Replies" of "all recent posts" it is indicated whether there have been submitted new posts to the topic since the last login/visit. Could such a thing be implemented also for the "my recent posts"? If affirmative, I think it would make it easier not to overlook any post which needed ones attention.
First 6 7 8 9 10 11 12 Page 8 of 12