Post Reply 
Problem with a list in CAS-program
10-11-2017, 06:45 PM
Post: #9
RE: Problem with a list in CAS-program
The square brackets [] are used in the xcas documentation for list indexing.

On the Prime the parentheses () work well in CAS with a numerical index :
Code:
l1:=MAKELIST(1,I,1,8)
l1(3):=l1(3)+1

   

However it doesn't work in CAS when the index is a variable as it is parsed as something different :
Code:
k:=3
l1(k):=l1(k)+1
is converted to:
Code:
l1:=(k)->l1(k)+1
after a warning message "l1: recursive definition"

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


Messages In This Thread
RE: Problem with a list in CAS-program - Didier Lachieze - 10-11-2017 06:45 PM
Problem with a list in CAS-program - Rudi - 10-29-2017, 04:55 PM



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