tuple.index()

Nick Maclaren nmm1 at cus.cam.ac.uk
Thu Dec 21 05:15:54 EST 2006


In article <mailman.1895.1166684321.32031.python-list at python.org>,
"Hendrik van Rooyen" <mail at microcorp.co.za> writes:
|> "Nick Maclaren" <nmm1 at cus.cam.ac.uk> wrote:
|> 
|> > Not at all.  I didn't say that they came in pairs.  Consider:
|> > 
|> >     [str1, str2, agent1, str3, agent2, agent3, agent4, str4, ...]
|> > 
|> > See Algol 68 for an example of this.
|> 
|> When I looked at the above, I went "tilt" -

Yes, you are confused :-)  Neither the agents nor strings take the
other as 'arguments', but are effectively methods of the I/O object.
Let's consider a modern example:  a text editor with hyperlink
facilities.  Note that I am referring to the hyperlinks of the kind
that can occur anywhere, and not those associated with a particular,
usually highlighted, word.

Text is a sequence of letters/words/sentences/paragraphs/markup/etc.;
let's assume words, as strings, for the purpose of argument.  Words
can be inserted, deleted, changed etc.

Hyperlinks are agents and can be added at any point.  Their only
relationship with the text is the position at which they occur (i.e.
none or more may occur between any two consecutive words).


Regards,
Nick Maclaren.



More information about the Python-list mailing list