Post Reply 
concat in CAS
11-16-2014, 04:50 AM (This post was last modified: 11-16-2014 04:55 AM by Han.)
Post: #2
RE: concat in CAS
The CAS behavior is slightly different from the Home behavior because it has two ways to represent lists. Lists are either delimited by {}, or by []. This can be verified by typing (in CAS):

type([1,2]); // note the lower-case type() command and not TYPE()
type({1,2});

both report DOM_LIST as the CAS type. You may not be aware that simply typing in:

1,2,3,4

into the command line in the CAS view creates a (CAS) list of the form [1,2,3,4]. In fact, typing any sequence of values or expressions separated by commas will create a similar "list". The help text for the command indicates that when providing more than 2 arguments to the command, all arguments are then placed into a list. Thus,

CONCAT({1,2}, {3,4}, {5,6});

would result in [ {1,2} {3,4} {5,6} ] which is a list of the three arguments passed to CONCAT(). Strangely, the behavior in Home does not follow this rule, so that

CONCAT({1,2}, {3,4}, {5,6});

actually produces {1,2,3,4,5,6}. If there is a bug, I would think that it is more likely in the Home behavior than the CAS behavior (if we are to adhere to the Help screen for the command, that is).

P.S. The use of both {} and [] for lists (while I don't like it myself), is common in many various implementations of computer algebra system). What muddies the water even more is that {} are also used for sets.

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


Messages In This Thread
concat in CAS - Gilles - 11-15-2014, 09:41 PM
RE: concat in CAS - Han - 11-16-2014 04:50 AM
RE: concat in CAS - parisse - 11-16-2014, 06:59 AM
RE: concat in CAS - Han - 11-16-2014, 03:16 PM
RE: concat in CAS - Gilles - 11-16-2014, 09:36 AM



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