list command - Printable Version +- HP Forums (https://www.hpmuseum.org/forum) +-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html) +--- Forum: HP Prime (/forum-5.html) +--- Thread: list command (/thread-1205.html) |
list command - Alberto Candel - 04-30-2014 03:53 PM 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. RE: list command - Han - 04-30-2014 04:34 PM (04-30-2014 03:53 PM)Alberto Candel Wrote: Hello, 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. RE: list command - Alberto Candel - 04-30-2014 04:41 PM 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. RE: list command - Tim Wessman - 04-30-2014 05:16 PM 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]) Using that, MAKELIST(A,A,1,4) will do what you have indicated. RE: list command - Alberto Candel - 04-30-2014 05:35 PM (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? 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. RE: list command - Alberto Candel - 04-30-2014 11:57 PM 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 [attachment=612] Then I moved over to CAS to work on this graphics object GA, [attachment=613] 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[...] [attachment=614] RE: list command - Angus - 05-01-2014 12:27 PM 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. RE: list command - Tim Wessman - 05-01-2014 02:04 PM (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. RE: list command - Angus - 05-01-2014 03:40 PM 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? RE: list command - Alberto Candel - 05-01-2014 05:28 PM You can use CAS functions in the Geometry Symbolic View, like convexhull: [attachment=620] Then GB is not a list proper for CAS. But what I find confusing is that you can CAS-operate on GA, like this [attachment=619] and now it behaves like a list. RE: list command - Tim Wessman - 05-01-2014 09:38 PM 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! RE: list command - Alberto Candel - 05-01-2014 09:47 PM (05-01-2014 09:38 PM)Tim Wessman Wrote: GA is actually not a list, but a sequence. Sequences have different rules. Great, thanks! In the meantime, where do I find more about the rules governing sequences? I cannot find them in the HPPrime User Guide. RE: list command - Tim Wessman - 05-01-2014 10:34 PM Only in the xcas documentation. RE: list command - Alberto Candel - 05-02-2014 01:09 AM (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. RE: list command - Angus - 05-02-2014 08:10 AM 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. RE: list command - parisse - 05-03-2014 09:26 AM 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). RE: list command - Alberto Candel - 05-05-2014 08:54 PM (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? 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. |