Post Reply 
Debugging With an Orange Bang
06-30-2017, 01:38 PM
Post: #10
RE: Debugging With an Orange Bang
(06-30-2017 01:14 PM)Didier Lachieze Wrote:  
(06-30-2017 12:26 PM)toml_12953 Wrote:  In order for that to work, c has to either be global or be passed by reference. Otherwise modifying the values in c in the function circl won't modify the values in the main program. At least that's what I've found in regular programs. Maybe in CAS programs it's different? If so, I'll be making most of my programs CAS from now on. Thanks for your time and expertise on this!

Ok, I understand now what you're trying to do. But when you call circl with: circl(c,p) the parameters are not passed by reference as described for the xcas functions: "It is not possible to pass arguments by reference, only by value." I don't think it is different on the Prime.

So circl get a copy of c and whatever you do on it with := or =< , this will not change the value of c in the main program. At least this is how I understand it.

You can have c declared as a global variable but in this case it should not be a parameter of circl and then whatever change is done in circl will be visible to the main program but there is no need to use =< for that.

My original program worked and did use c as a global array but I was hoping to eliminate that with =<.
So what is the point of =< as opposed to := ? I thought =< was supposed to modify by reference. If it doesn't, I really don't see the utility of it.

Tom L
Cui bono?
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Debugging With an Orange Bang - toml_12953 - 06-29-2017, 02:58 AM
RE: Debugging With an Orange Bang - toml_12953 - 06-30-2017 01:38 PM



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