sequence is generated by appending elements at its end after having placed rider on the file assuming the declaration var rrider we position the rider on the file by the statement set(rfposwhere pos designates the beginning of the file (sequencea typical pattern for generating the sequence iswhile more do compute next element xwrite(rxend sequence is inspected by first positioning rider as shown aboveand then proceeding from element to element typical pattern for reading sequence isread(rx)while ~ eof do process element xread(rxend evidentlya certain position is always associated with every rider it is denoted by pos furthermorewe postulate that rider contain predicate (flagr eof indicating whether preceding read operation had reached the sequence' end we can now postulate and describe informally the following set of primitive operators new(fnamedefines to be the empty sequence old(fnamedefines to be the sequence persistently stored with given name set(rfposassociate rider with sequence fand place it at position pos write(rxplace element with value in the sequence designated by rider rand advance read(rxassign to the value of the element designated by rider rand advance close(fregisters the written file in the persistent store (flush buffersnote writing an element in sequence is often complex operation howevermostlyfiles are created by appending elements at the end translator' note primerakh programm knige ispol'zuiutsia eshche dve operatsii writeint(rnplace the integer in the sequence designated by rider rand advance readint(rnassign to the integer value designated by rider rand advance in order to convey more precise understanding of the sequencing operatorsthe following example of an implementation is provided it shows how they might be expressed if sequences were represented by arrays this example of an implementation intentionally builds upon concepts introduced and discussed earlierand it does not involve either buffering or sequential stores whichas mentioned abovemake the sequence concept truly necessary and attractive neverthelessthis example exhibits all the essential characteristics of the primitive sequence operatorsindependently of how the sequences are represented in store the operators are presented in terms of conventional procedures this collection of definitions of typesvariablesand procedure headings (signaturesis called definition we assume that we are to deal with sequences of charactersi text files whose elements are of type char the declarations of file and rider are good examples of an application of record structures becausein addition to the field denoting the array which represents the datafurther fields are required to denote the current length and positioni the state of the rider