Post Reply 
How to pass by reference in XCAS ?
10-26-2020, 11:17 AM
Post: #3
RE: How to pass by reference in XCAS ?
You can emulate pass by reference by putting data inside a list

XCas> add1(lst) := {local I; for I from 1 to len(lst) do lst(I) += 1 end}
XCas> a := [1,2,3]
XCas> add1(a)       → [2, 3, 4]
XCas> add1(a)       → [3, 4, 5]
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: How to pass by reference in XCAS ? - Albert Chan - 10-26-2020 11:17 AM



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