> On May 3, 2009, at 4:51 PM, Steve Willoughby wrote: > > AGSCalabrese wrote: >> What I am really after is a tutorial that describes string >> operations. I am >> teaching some students about strings. >> I wanted to find some tutorial that explained concatenation, >> string length, getting a character at position "n", 8 bit and 16 bit > > But right there you have implementation-dependent concepts. Take > string > length. All you can say without looking at an implementation is > "strings consist of a number of characters (whatever a character might > or might not BE on a particular platform), and you can do something > language-specific to see what the number of characters is." Beyond > that, what, exactly, could you say without knowing what characters are > and how the strings are represented? I don't see a problem with simply stating that characters can be 8 bit or 16 bit and that a string might start with a header and might end with a trailer which would affect the value of "n". ( and that there might be variations where characters were 6,7, 9 or whatever bits. ) Gus > > > Getting a character at position N is the same. What "position N" even > means is language dependent. How to "get" a "character" is also. > >> characters, capitalization and capitalization not. Also string to >> <--> hex conversion, string <--> decimal conversion , character >> <--> ASCII value and more. These things can be explained without >> requiring a specific implementation. > > I'd love to see how they can be explained in any useful way without > assuming a particular implementation. (Silently assuming one and just > not calling out what it is doesn't count.) I am confident I can write a tutorial. I just wanted to steal one from someone else. I would do what you are suggesting ( silently assuming and mixing various implementations without mentioning them explicitly ) Gus > > > I've taught no small number of programming classes myself, and I'm a > little mystified by what's driving you to take this angle. I'd > explain > strings very briefly in abstract but from there I think anything > meaningful would better be done by picking a sample implementation > (ANY > one) and showing concrete examples and actually working with them. > -- -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist