Post Reply 
list command
04-30-2014, 03:53 PM
Post: #1
list command
Hello,

I cannot find any documentation about the "list" command. I stumbled upon it in trying to make a list out of a sequence of numbers. For example I was hoping that input list(1,2,3) will create the list [1 2 3], but it does not.

If I type list(1) I obtain 256. If I type list(2) I obtain 512, which is list(1)*2.
it accepts multiple arguments: list(1,2,3) outputs [256 512 768]

It does not seem that it is something I have in memory or anything....so I thought someone may know. Thanks.

A.
Find all posts by this user
Quote this message in a reply
04-30-2014, 04:34 PM
Post: #2
RE: list command
(04-30-2014 03:53 PM)Alberto Candel Wrote:  Hello,

I cannot find any documentation about the "list" command. I stumbled upon it in trying to make a list out of a sequence of numbers. For example I was hoping that input list(1,2,3) will create the list [1 2 3], but it does not.

If I type list(1) I obtain 256. If I type list(2) I obtain 512, which is list(1)*2.
it accepts multiple arguments: list(1,2,3) outputs [256 512 768]

It does not seem that it is something I have in memory or anything....so I thought someone may know. Thanks.

A.

To create list, use MAKELIST, makelist, or seq. The other alternative is to simply manually type it: {1,2,3} or [1,2,4] or (1,2,3)

The reason there is no documentation on the "list" command is because it really isn't a command but a fixed constant (whose value is 256). So list(2) is actually doing list*2 which is why you are seeing 512 as the result. Likewise, list(1,2,3) is parsed as 256*(1,2,3). Hope that helps.

Graph 3D | QPI | SolveSys
Find all posts by this user
Quote this message in a reply
04-30-2014, 04:41 PM
Post: #3
RE: list command
Thank Han, that helps. I actually stumbled upon list because MAKELIST was not what I needed. For example, MAKELIST(1,2,3,4) does not produce [1 2 3 4].

Anyway the reason behind all this has to do with using list from the symbolic graphic in CAS, but probably best leave that for later.

A.
Find all posts by this user
Quote this message in a reply
04-30-2014, 05:16 PM (This post was last modified: 04-30-2014 05:17 PM by Tim Wessman.)
Post: #4
RE: list command
Are you aware you have contextual help in the calculator that contains about 1/2 of the entire manual?

Find makelist in the LIST->MATH toolbox menu, select it, press help. This is what is shown.

Quote:Syntax: MAKELIST(expression, variable, begin, end, [increment])

Make List. Calculates a sequence of elements for a new list. Evaluates expression, incrementing variable from begin to end values, using increment steps (default 1). The MAKELIST function generates a series by automatically producing a list from the repeated evaluation of an expression.

Example: MAKELIST(2*X-1, X, 1, 5, 1) returns {1, 3, 5, 7, 9}

Using that, MAKELIST(A,A,1,4) will do what you have indicated.

TW

Although I work for HP, the views and opinions I post here are my own.
Find all posts by this user
Quote this message in a reply
04-30-2014, 05:35 PM
Post: #5
RE: list command
(04-30-2014 05:16 PM)Tim Wessman Wrote:  Are you aware you have contextual help in the calculator that contains about 1/2 of the entire manual?

Find makelist in the LIST->MATH toolbox menu, select it, press help. This is what is shown.

Quote:Syntax: MAKELIST(expression, variable, begin, end, [increment])

Make List. Calculates a sequence of elements for a new list. Evaluates expression, incrementing variable from begin to end values, using increment steps (default 1). The MAKELIST function generates a series by automatically producing a list from the repeated evaluation of an expression.

Example: MAKELIST(2*X-1, X, 1, 5, 1) returns {1, 3, 5, 7, 9}

Using that, MAKELIST(A,A,1,4) will do what you have indicated.

Thanks. Yes, I was aware of how MAKELIST works. I just wrote an example off hand to explain how I came up with list.

My issue with lists has to do with how CAS and Symb Geometry App interact. For example, in Symb Geom convexhull applied to a list of points a+b*i creates a list, which becomes available to CAS functions, but sometimes I cannot manipulate that list the way I want. Anyway, I will need to explore this further and then try to formulate a question.

A.
Find all posts by this user
Quote this message in a reply
04-30-2014, 11:57 PM (This post was last modified: 04-30-2014 11:58 PM by Alberto Candel.)
Post: #6
RE: list command
Here is how I found the list command (which is apparently the number 256)

In Geometry Symbolic View I entered a sequence of points like so

   


Then I moved over to CAS to work on this graphics object GA,

   


It seems that GA is not a list after all. The command at(a,1) is the result of typing a[1] (square brackets)

I went back to Symb and edited GA by adding {...}. It reads as list[...]

   
Find all posts by this user
Quote this message in a reply
05-01-2014, 12:27 PM
Post: #7
RE: list command
I remember that in a former thread parisse pointed out the idea of manipulating geometry objects with cas commands, i.e. using the cas for working with app data. However looking at your screenshots shows, again, that the variable system and scope of commands is problematic. Very problematic for intuitive usage.
I am curious if these things will be covered in the expected update. Hopefully HP admitted to themselves that there are issues to deal with.

I am curious about examples and the results of your work. Please keep us informed.
Find all posts by this user
Quote this message in a reply
05-01-2014, 02:04 PM (This post was last modified: 05-01-2014 02:07 PM by Tim Wessman.)
Post: #8
RE: list command
(05-01-2014 12:27 PM)Angus Wrote:  that the variable system and scope of commands is problematic. Very problematic for intuitive usage.

Unfortunately, this has nothing do with variables nor scope and everything to do with creating an unknown/unintentional object. The CAS has support for a "sequence", which is basically just a group of things separated by commas. However, they aren't lists, nor vectors and really purely just a list of separated items. They don't behave like lists nor vectors and frankly I've always been confused by them because they appear to have been tacked on very late to the xcas codebase it seems. Either I am just not understanding why or what they would be useful for, or they are half baked. I lean towards the first idea though.

They seem to be modeled after the sequence behavior in maple.

That being said, I do think we need to do something to better clarify when something is one of these sequence items and figure out a different way to display them. So I've filed that as and item to examine.

TW

Although I work for HP, the views and opinions I post here are my own.
Find all posts by this user
Quote this message in a reply
05-01-2014, 03:40 PM (This post was last modified: 05-01-2014 03:49 PM by Angus.)
Post: #9
RE: list command
I did not talk about 'list' in particular. I noticed the need for assigning G to g for any cas-usage e.g. That is built in fixed Variable names. Capitalized and small. The app is supposed to work together with the cas - the needed variable names are incompatible for the called functions.

I think we won't get anywhere with that. I have the feeling you just cannot follow my feelings about these issues. But I just don't know how to express my thoughts in a different way. Mostly it is a generizable critique (and of course the problem could be me, but I don't get that either).

As a moral I will, of course, think about what you said and try to dig deeper into the calculator. Can you explain why GA(1) fails and ga(1) works?
Find all posts by this user
Quote this message in a reply
05-01-2014, 05:28 PM
Post: #10
RE: list command
You can use CAS functions in the Geometry Symbolic View, like convexhull:

   

Then GB is not a list proper for CAS. But what I find confusing is that you can CAS-operate on GA, like this

   

and now it behaves like a list.
Find all posts by this user
Quote this message in a reply
05-01-2014, 09:38 PM
Post: #11
RE: list command
GA is actually not a list, but a sequence. Sequences have different rules.

However, I am seeing now what was being talked about regarding the direct call of GA not behaving the same as if you recall the contents and store it into another variable. You are correct that such a step should not be necessary. I have put it onto the list of items to investigate. Thanks!

TW

Although I work for HP, the views and opinions I post here are my own.
Find all posts by this user
Quote this message in a reply
05-01-2014, 09:47 PM
Post: #12
RE: list command
(05-01-2014 09:38 PM)Tim Wessman Wrote:  GA is actually not a list, but a sequence. Sequences have different rules.

However, I am seeing now what was being talked about regarding the direct call of GA not behaving the same as if you recall the contents and store it into another variable. You are correct that such a step should not be necessary. I have put it onto the list of items to investigate. Thanks!

Great, thanks! In the meantime, where do I find more about the rules governing sequences? I cannot find them in the HPPrime User Guide.
Find all posts by this user
Quote this message in a reply
05-01-2014, 10:34 PM
Post: #13
RE: list command
Only in the xcas documentation.

TW

Although I work for HP, the views and opinions I post here are my own.
Find all posts by this user
Quote this message in a reply
05-02-2014, 01:09 AM
Post: #14
RE: list command
(05-01-2014 10:34 PM)Tim Wessman Wrote:  Only in the xcas documentation.

I am not sure about that. Here on page 13 says that you can make a list out of a sequence seq by putting it into square brackets: [seq] is a list whose elements are the terms of the sequence seq. But that does not seem to work in the HP prime for my GA example.

Thank you.

A.
Find all posts by this user
Quote this message in a reply
05-02-2014, 08:10 AM
Post: #15
RE: list command
I've re-read my previous post and noticed that it might be considered rather rude. If that is the case I would like to apologize- that was certainly not intended.
For me it is analogous with home/cas Variables. You enter an expression in the drawing app using 'X'. Wouldn't it be nice if an 'x' was an 'X' and everything in the calculator could be manipulated at an other place without considering what kind of object that was?
That is what most criticism was about when talking about the variable and typo confusion.
Find all posts by this user
Quote this message in a reply
05-03-2014, 09:26 AM
Post: #16
RE: list command
A sequence is a basic container for objects, for example for functions with several arguments (the arguments of the function are grouped in a sequence). From a sequence you can make a list or vector (there is no difference inside the CAS), or a set (objects are unique) or a univariate polynomial (dense representation: list of coefficients by decreasing order) by using the appropriate delimiters: [] for lists or vectors ({} also accepted on the prime), set[ ] for sets or poly1[ ] for univarite polynomials. Conversly you can get a sequence from a list with op. The main difference between a sequence and a list is that you can not make a sequence of sequences: using comma between 2 sequences concatenates them (at evaluation step).
Find all posts by this user
Quote this message in a reply
05-05-2014, 08:54 PM
Post: #17
RE: list command
(04-30-2014 05:16 PM)Tim Wessman Wrote:  Are you aware you have contextual help in the calculator that contains about 1/2 of the entire manual?

Find makelist in the LIST->MATH toolbox menu, select it, press help. This is what is shown.

Quote:Syntax: MAKELIST(expression, variable, begin, end, [increment])

Make List. Calculates a sequence of elements for a new list. Evaluates expression, incrementing variable from begin to end values, using increment steps (default 1). The MAKELIST function generates a series by automatically producing a list from the repeated evaluation of an expression.

Example: MAKELIST(2*X-1, X, 1, 5, 1) returns {1, 3, 5, 7, 9}

Using that, MAKELIST(A,A,1,4) will do what you have indicated.

I had sometime to explore MAKELIST. In CAS, the command MAKELIST(e^{2*k*pi*i}, k,1,5) produces an empty list [[]]. In HOME it works, provided X replaces k.
Why is it? What am I misinterpreting?

Thank you

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




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