Carl Love

Carl Love

16944 Reputation

24 Badges

7 years, 233 days
Mt Laurel, New Jersey, United States
My name was formerly Carl Devore. I was in the PhD math program at University of Delaware until 2005. I was very active in the Maple community at that time.

MaplePrimes Activity

These are replies submitted by Carl Love

@janhardo From closely reading your loop attempts, I see that you're really struggling with it. Here's a simple straightforward procedure with a loop to sum the elements of a list of arbitrary length:

SumList:= proc(L::list)
local S:= 0, i;
    for i to nops(L) do
        S:= S + L[i]
end proc;

Please study this thoroughly and let me know if you have any questions.

@janhardo I think that I'll wait until you've learned the while clause of the do statement before I explain further. But note that it's not an until statement; the until part is a clause that terminates the preceding do statement.

In my opinion, Maple is not well suited to derive the displayed form from your typed form. If, however, you want to verify whether the two forms are equivalent, Maple is good at that.

I totally understand why you'd want to come up with contrived examples such as you have been as a means of experimentation. I do the same thing myself. So, don't take my Answers too harshly; I encourage you to experiment.

Pedagogic advice: You'll learn a lot if you try to remove from your examples everything that doesn't cause the anomaly. In all intellectual pursuits, there is an art to creating good examples.

@Carl Love In the future, I'll say implicitLY local rather than implicit local because the latter may be more likely to give the false impression that there are two types of locals with different semantics.

@radaar In the example that you just posted, a is still local.

@radaar As I told you in another thread, there's no semantic difference between implicit and explicit locals, and there never has been. So I don't know how you acquired that "understanding". There's no good reason to ever ignore the warning about implicit locals. 

In the second procedure, a is local for the entire procedure. It does not suddenly become local at the point that the "compiler" realizes that it should be flagged as implicit local. If you look at the "compiled" procedure with showstat, you'll see local a at the top.

@mmcdara Yes, you could use define. Personally, I've never encountered a situation where I preferred using define.

@mmcdara put 

I mean that you can write e mod m; there's no need to put the operator first. If you do put the operator first, then it must be in quotes.

@mmcdara The first, or left, argument to mod can be almost anything, including a container. There's no need for you to use mod in prefix form, i.e., as `mod`.

@stefanv Thank you, Stefan. If something akin to what you wrote above were included in the help pages of seqadd, and mul, I'd consider the matter to be fully documented.

@radaar Thanks. I have read this book, and in my opinion it is by far the best book about Maple. Although most of this book is already incorporated into the Maple help pages (see ?ProgrammingGuide), it's much more convenient in PDF form.

@radaar What don't you understand about Kitonum's example? The f and are considered "equal" at this point, although it's difficult to say precisely what "equal" means in a Maple context. From a mathematical viewpoint, they are unquestionably equal. From Maple's viewpoint, we have

evalb(eval(f) = eval(g));


evalb(addressof(eval(f)) = addressof(eval(g)))

That shows that they are "currently" equal, but they could become unequal if they acquire different remember tables. For example, this would make them unequal:

f(3):= 7;

All of this has nothing to do with the global assignments to x and t; indeed it would all be the same even if there had been no assignments to x and t.

@radaar Yes, all that you just said is correct.

@radaar In your latest example, the first x is global (as you noted), all of the xs in ff are still a formal parameter (this time with a default value), and the x in ff(x) is an argument as well as a global. There is no connection between the formal parameter x and the other xs other than that they have names that are just coincidentally spelled the name. 

I don't know if you had any question about this example. There's not much subtlety involved here, and none of this is adequate to describe PLBVs.

1 2 3 4 5 6 7 Last Page 1 of 513