BACKSLASHEDP

Synopsis
BACKSLASHEDP character
BACKSLASHED? character
Description

Outputs TRUE if character was originally entered between vertical bars (|) and is a space, tab, newline, or one of ()[]{}|+-*/=<>":;\~?. Outputs FALSE, otherwise.

In FMSLogo, BACKSLASHEDP has nothing to do with backslashes, but its name was retained for compatibility with older programs. All regular backslashes are removed after tokenization, but the vertical barring is retained. VBARREDP would be a more appropriate name.

In older versions of Logo, BACKSLASHEDP output whether or not a character had been escaped with a backlash in order to suppress the normal semantics of the character. For example, a space character normally terminates a word, but a backslashed space is included within the word. When Logo only supported the 7-bit ASCII character set, each character was stored internally as an 8-bit byte and the backslash was stored in the 8th bit of each byte. Thus, every character could have a backslash and the name "BACKSLASHEDP" made sense.

To enable FMSLogo to support languages other than English, it was expanded to store characters as 16-bit values from the Unicode BMP. As a result, the 8th bit can no longer be used to store the backslash. Fortunately, preceding most characters with a backslash doesn't change their meaning. For example \A and A mean the same thing; the backslash is essentially ignored. However, for a small number of characters, including the space character, the backslash still needs to be stored with the character. To preserve this information, such characters are mapped to the Private Use Area of the Unicode BMP. For example, the space character has a code point of 32, but a backslashed space is internally represented as code point 57344.

Example
SHOW BACKSLASHEDP "a
false
SHOW BACKSLASHEDP "|a|
false
SHOW BACKSLASHEDP "|(|
true
SHOW BACKSLASHEDP "\(
false

SourceForge.net Logo