Original date:2014-08-12 16:12:45 Edited by: Nevla Subject: Re: Couple of questions about sequences

DerekParnell said...
Nevla said...

What I meant was the case when named *variables* are used to reference the indexing of some data stored within a sequence whose structure is changing. Suppose the case where your data elements are initially assigned positions 1,2,3,4,5... within a sequence, but later on, because of the changes that take place within the sequence, their indexing position changes. So, in this case I would need to re-assign a new indexing value to each of the named variables, to reflect the new structure.

You really want to do that?! Seriously?! Why? Can you describe a real-life example of where this is the best algorithm to use?

OK, most probably you are right, Derek. You see, I was not asking the question having a real-life in example in mind. I am a total newbie at Euphoria and I was reading in the documentation that the structure of sequences keeps changing, because they are dynamic structures. So, I was just assuming that in order to store one's data into sequences one needs to have some fail-safe mechanism to make sure that the stored data does not become inaccessible when the sequence's structure changes. It was just a conjecture on my part. But now, thanks to the posts in this thread, I am realizing that the change in the sequence's structure, which is certainly something undesirable if you have to use sequences as records, will probably be a rare occurrence. So I guess I will not have to worry much about it.

Nevla said...

Now, if the "coordinates" of the stored data within a sequence keep changing all the time, and there are several independent elements to keep track of, managing their referencing through named variables may become a challenge. My question was about the best way to maintain an auto-updating sort of lookup table via named variables, to cope with the the changes that take place in the sequence structure.

I can think of a few ways to do this, but the extra work involved doesn't seem to be worth the effort. I'd still like to see a scenario where this type of behaviour is necessary in a program. [/quote]

Same as above. Coming to think about it, probably it would not be needed, after all.

Not Categorized, Please Help


Quick Links

User menu

Not signed in.

Misc Menu