Talking Emoticons

'...' is not a Forth word, it is used here to indicate an arbitrary sequence of Forth words.

However, it could be a Forth word, as '...' is a permissible name. The rules for naming Forth words are;

  1. No spaces or non-printing characters.
  2. 32 Characters maximum.
This permissive attitude is typical of Forth. It has very few rules, but lots of conventions. One that we have seen already is using . 'dot' to mean 'print'. So ." means print something. In this instance print a string literal delimited by the following " (Another Forth convention).

As an example, we could devise a program that explains 'Smileys'; when the user types them at the command line;

   : :-)  ." I'm a happy face, indicating a light hearted comment." ; 

   : :-(  ." I'm a sad face, indicating displeasure." ; 

   : [:-|]  ." I'm Frankenstein's monster." ; 

   : >+++:)  ." I'm a skeletal fish, indicating something fishy here." ; 
      
And so on...

I wanted to know that!