Post Reply 
Recursive programs in XCAS.
02-12-2017, 02:52 AM
Post: #5
RE: Recursive programs in XCAS.
First, please understand that non-CAS programs do not behave the same way as CAS programs. The combo set program is a non-CAS program. So commands like makelist() are actually two different commands:

In "Home" programs (i.e. non-CAS programs), upper/lower case does not matter. So makelist() is actually parsed as MAKELIST(), which is a different command from the CAS makelist(). In CAS programs, upper/lower case DOES matter.

The CAS version of makelist() is:

makelist( cas-function, var, start, end )

where cas-function is an actual function. For example, when you define a function f(x):=x^2 in the CAS view, you are actually creating the variable f whose content is the CAS-object (x)->x^2. The point here is that f(x):=x^2 is the same as f:=(x)->x^2. So it is this type of function (the right hand side being an example) that is the first argument in makelist(). In your case,

makelist( (X)->s[X], X, 1, m )

is what you would want. Notice the s[X] as opposed to s(X) -- this is to remove any ambiguity in the CAS side whether s is a function vs. an indexed object (i.e. list).

Graph 3D | QPI | SolveSys
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Recursive programs in XCAS. - John P - 02-12-2017, 12:22 AM
RE: Recursive programs in XCAS. - Han - 02-12-2017, 01:41 AM
RE: Recursive programs in XCAS. - John P - 02-12-2017, 02:08 AM
RE: Recursive programs in XCAS. - John P - 02-12-2017, 02:32 AM
RE: Recursive programs in XCAS. - Han - 02-12-2017 02:52 AM
RE: Recursive programs in XCAS. - Han - 02-12-2017, 04:06 AM
RE: Recursive programs in XCAS. - Han - 03-01-2017, 04:46 AM
RE: Recursive programs in XCAS. - Han - 03-01-2017, 04:49 AM



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