Post Reply 
[Request] for renaming variables
05-30-2014, 07:08 AM
Post: #11
RE: [Request] for renaming variables
Hello,

>There is a major drawback with this solution: speed. f(x):=sin(x) then F1:=f(X) and F2:=2*sin(X) and you'll see how dramatically faster F2 is compared to F1.

Yep, it is because F1 will be f(x) and not sin(X). As a result, EVERY call to evaluate F1 will be a call to the CAS instead of a numerical call and there is a high cost to call the CAS from the numerical world (which is where the function app resides)...

> Difference between Function.F1:=f and only F1? Why do you see the Function.F1:=f typing and why did CR Haeger use it?

You would use Function.F1:= when F1 by itself is ambiguous..
As a general rules, varaibles are contextual. so you would not be able to access an app variable directly unless it is the current app OR you provide the namespace information by doing namespace.variable
Now, in the case of F1 (and a few others), if no F1 is found in the system, it will use the Function.F1 even if Function is not the current application (to make things easy for non strict people). This does lead to confusion for the rest of us..
Nevertheless... you would use Function.F1 if Function is NOT the current app (and you wanted to be strict), if you had another F1 defined, or if the current app was a function app, but not the one called Function.

cyrille
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
[Request] for renaming variables - Tugdual - 05-28-2014, 08:58 PM
RE: [Request] for renaming variables - cyrille de brébisson - 05-30-2014 07:08 AM



User(s) browsing this thread: 1 Guest(s)