Post Reply 
List indexing problems
10-02-2016, 07:32 PM (This post was last modified: 10-02-2016 07:34 PM by TravisE.)
Post: #5
RE: List indexing problems
To me, {1,2,3}2 vs. {1,2,3}(2) (or {1,2,3}[2]) look like two different things. It would seem reasonable to treat a numeric expression in parentheses or square brackets directly after any list expression (explicit or as a variable) as a subscript if there is no '*' operator. Maybe there would be users expecting implied multiplication whom this would trip up, but as things are, it appears a lot easier to work around that (just type a *) than it currently is to convince the Prime parser that I want list subscripting and not implied multiplication. Except, of course, now changing anything is apt to cause compatibility issues with programs of older OS versions. Sad

(For what it's worth, it seems that both the TI-89/89T and 50g in algebraic mode have managed to support implied multiplication without this trouble with list indexing syntax, though maybe I'm missing something in the big picture.)

I agree that despite the temptation, having an option for implied multiplication probably isn't a good idea. Just look at how much trouble the .,; separator stuff causes. Wink And the flags on the 48/49/50 are a pain as well, especially the ones that change the effective semantics of the programming language itself (e.g., LASTARGS vs. IFERR). But I think this does reflect a possible weakness in the parser or syntax design (such as too many cases of ambiguous syntax, perhaps, or not enough provision for explicitly indicating the desired operation to the parser in such cases).

I don't know, maybe adding 49/50-style “get” and “put” functions as alternate list subscripting syntax (to use in cases where implied multiplication would otherwise get in the way) would provide an escape route without breaking the existing things too much?
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
List indexing problems - TravisE - 10-01-2016, 05:16 AM
RE: List indexing problems - TravisE - 10-01-2016, 09:29 PM
RE: List indexing problems - StephenG1CMZ - 10-02-2016, 07:38 AM
RE: List indexing problems - TravisE - 10-02-2016 07:32 PM



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