TEACH APOSTROPHE A.Sloman June 1988 APOSTROPHES IN LISTS AND IN RESPONSE TO READLINE ================================================ You will often want to include an apostrophe in some sentence represented as a list of words. In Pop-11 you can't do this easily because the symbol "'" has a special meaning. To Pop-11 it means "start (or finish) a string of characters". Once a string of characters starting with "'" has been read in Pop-11 expects it to be terminated by the same symbol, before the end of the line. So if a second "'" is not found before the end of the line, you'll get a mishap message. You can get a feel for the sort of thing that goes wrong if you type the following to Pop-11: [I do not know] => ** [I do not know] [I don't know] => ;;; MISHAP UTS: UNTERMINATED STRING: ;;; INVOLVING 't know] =>' Leave VED ( x) and try those commands. Then type TEACH; to come back here. Alternatively (if you have read TEACH MARK and TEACH LMR) you can mark the commands then do lmr. It is possible to include an apostrophe as a word if you use the "alphabeticiser" character, as explained in HELP * ALPHABETICISER. However, this is rather complicated for beginners. One possible source of confusion over apostrophes can occur if you type a list with two of them. The following doesn't produce a mishap, because all the characters between the two occurrences of "'" are put into a single string. Try it: [he can't and he won't do it] => ** [he can t and he won t do it] The funny grouping is a result of the string being formed. Compare: length([he cant and he wont do it]) => ** 7 length([he can't and he won't do it]) => ** 6 The same problem will arise if you type an apostrophe in response to READLINE. Leave VED and TRY: readline() => ? i don't know The mishap message should now be intelligible. If you define an ELIZA-like program (SEE TEACH ELIZA) then you may occasionally type things with apostrophes in to it, and you'll then get mishaps. However, the Eliza program defined in LIB ELIZAPROG is designed to read in apostrophes and ignore them. NOTE: There are ways of typing in strings which go over more than one line. In particular if the line ends with "\" i.e. the back-slash, Pop-11 will allow the string to continue. Alternatively, the variable POP_LONGSTRINGS can be given the value TRUE, instead of its default value FALSE. For more information see HELP * STRINGS. See also: HELP * WORDS --- C.all/teach/apostrophe --------------------------------------------- --- Copyright University of Sussex 1988. All rights reserved. ----------