home .. forth .. colorforth mail list archive ..

[colorforth] Primary ColorForth


Hi all,

I am not very good at FORTH or colorforth. I would like to lend a hand to the Primary ColorForth effort. I hopefully this will be thought of as brainstorming.

To follow in the steps of Starting Forth is a great idea. What I have read so far of Primary ColorForth is pretty close to Starting Forth. Mr. Drake has held to his goal.

Learnign FORTH is not learning ColorForth. New words cannot be defined on the command line. The editor is pretty much part of the language. The keyboard input is different. These are differences.

Mr. Moore talks about builing fresh code and rewrites. People will read this book to learn ColorForth not FORTH. I've never picked up a C++ book to learn C. Leave the comparisons behind. If this is a person's first language, they need to hear about ColorForth, not its differences with FORTH.

Code a ColorForth for the audience of learners. UI changes. Maybe change the use of the Alt button to t or g. In Windows, I have had a problem using the space bar after using the Alt. Windows thinks I would like to do something to the window size. Little things like that drive novices away. Use a # for switching to the numeric keystencils(decimal and hex) and a alpha for switching to the character keystencil. (I use the term keystencil to refer to the usual keyboard input modes. I use keymenu for the application menus.)

We factor in ColorForth. We should factor the 12 chapters of Starting Forth. There should be at least one chapter for every color. Maybe something along the lines of:

An overview of ColorForth
-Simplicity
-Logic
-Factoring

1 - Keystencils
-Character
-Numerical
-Mixed Usage

2 - Moving the Editor
-entering the editor
-Cursor moves
-Block moves

3 - White
-Comments with S,C,t
-Deleting and inserting

4 - Red
-Starting a word

5 - Green
-Finishing a word
-Introducing idea of compiled words
-exiting editor

6 - Executing Words
-load recently finished word
-run the word

and etcetera. Something like that would be more in the spirit of colorforth, I think.

Mr. Drake and Mr. Fox have shown their money. Here's my money in the form of the Keystencils chapter:

     The colorforth keyboard probably has a different layout than
you have used. On a normal keyboard, there are about 101 keys. In
colorforth, 27 out of 101 keys are used. The keys used in
colorforth are:

q w e r    u i o p
a s d f    j k l ;
z x c v  n m , . /
     (space) (atl)

On screen however, the used keys are shown in the bottom right
hand corner like this:

p y f i  g c r l
a o e u  h t n s
q k x d  b m w v
        .9 j

Symbols in the "." position entered using the the "n" key. Symbols
in the "9" position are entered using the spacebar. You guessed
it, the symbols in the "j" position are the entered using the
"alt" key.

The key layout in the right hand corner of the screen is called
the keystencil. A stencil shows what will be left after being
colored. Here the keystencil shows what the input can be. Starting
colorforth, the character keystencil (CK) shown is:

p y f i  g c r l
a o e u  h t n s
q k x d  b m w v
         9 x

Where is the "." symbol? Good question. There will be no input
from the "n" key with this keystencil. Press the "x" in the "alt"
position. What happened? A new keystencil appears:

: ; ! @  1 2 3
z j . ,  4 5 6 0
* / + -  7 8 9 ?
           a

This is the extended character keystencil (ECK). Here numerical
operators, punctuation, and the rest of the alphabet are located.
(I bet you were wondering how to spell zoo.) All of these
characters are to be thought of as letters. Examplpes are: "u r 2
cute," "l33t sp34k," set-5, or "2u/2me."

Why is there not something beside the 3? Try pressing the key
besides the 3. Nothing should happen. There will be no input from
that key with this keystencil.

The "9" has disappeared and the "x" turned into an "a." As
previous keystencil behaviour dictates, there will be no input
from the spacebar. Pressing "a" now changes this keystencil back
to the default character keystencil.

Press the "9". The decimal keystencil (DK) shows:

         1 2 3
         4 5 6 0
         7 8 9
       - a f

These are the decimal numbers. Pressing "-" will denote that a
negative number is being entered. Pressing "a" returns to the CK.
Press "f." The DK turns into the hexadecimal keystencil (HK),
which looks like this:

  a b c  1 2 3
  d e f  4 5 6 0
         7 8 9
       - a 9

It looks pretty familiar. Execpt that these numbers are hexadecimal.

Exercise:
Press b. See b appear on the bottom left. The HK has changed to the CK. Now press "9" again. The HK is still up. Press "9" and it changes to the DK. What happened in the bottom left of the screen? That's right the b changed to an 11. b is hexadecimal for 11.

End of Chapter so Far

I think I should probably factor that chapter into 2 chapters of Numerical Keystencils and Character Keystencils. I have some work to do on it. Probably add more exercises. Maybe add a chapter on bases after the Numerical chapter.

I would like to hear your thoughts and criticisms. I also hope I made sense.

Thanks,

Josef

---------------------------------------------------------------------
To unsubscribe, e-mail: colorforth-unsubscribe@xxxxxxxxxxxxxxxxxx
For additional commands, e-mail: colorforth-help@xxxxxxxxxxxxxxxxxx
Main web page - http://www.colorforth.com