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

[colorforth] ColorCoding and Color Coding Conventions


URL Chuck's color sample is
http://www.geocities.com/eleks_76/accgen-impl.html
I put a colorized version of this table at Win32Forth@xxxxxxxxxxxxxxx by the
same name

I hope you can make suggestions and corrections for which color should
signify what actions are to be expected from a particular word.  I think it
is very helpful to be able to tell if a word is a VALUE a VARIABLE or a
CONSTANT by it's color.  It is also nice to know if a word is a DEFERRED
word or if it is a word in a CLASS.  (OO is still a mystery to me.)


Albert Nijhof has presented another color coding for Forth at a recent
meeting of the Dutch Forth chapter.  I saw it on CLF and I have tried to
make a list for your critique. Then I will work on automating WinEd since it
has all the basic stuff in three files -

LINE   FILE                   DEFINITION
111     WinEd.f                open-keywords  \ load keywords file
64       WinEdColorize.f    keycolors  \ create 14 colors
257     Colors.f                <none>  \ define the default color objects

After you open the file in WinEd Ctrl+Enter will give you a window where you
can enter the line number and you can jump there or you can use Ctrl+F to
find the word you are looking for.

But what is really needed is to settle on what colors make sense and convey
the most information.  Of course after the coding is done to make a defining
word to set the color for the defined work, then we can experiment.  JaP

==============================================
WORD           COLOR    SAMPLE
Immediate       Red      Compile
Compiled        Blue     1
Data                Green    Data pulled in by an executing word
Numbers         B or W      101  32,000
\                      Red      \ starts a comment
(                      Red      ( starts a comment )
Comments       Green    Body of a comment
)                      Green    ends a comment
:                       Red      Colon starts a definition
Word-Name   Green    Name-of-a-new-word defined by a colon
Words-in-line  Green    See below for a better way. . .
;                      Red      ; at end of definition
Defined #s       Blue/Red 1 2 3
Control words  Red      IF ELSE THEN DO LOOP BEGIN WHILE EXIT
Parameters      Black    (white if on black background)

A better way?
Constants      Purple
Values          Dark-Magenta
Variables      Light-Magenta WinEd uses  255 00 255  palettergb new-color
LTMAGENTA
Deferred
Code
:Object
:M             Red
Method-name    Red        Defined by :M
;M             Red
Methods
Class
Init

Available      Lime Aqua Teal  Grey  Silver

=================================================
--- The original text below from Albert and modified by me.
The original is here
http://groups.google.com/groups?q=color+group:comp.lang.forth.*&hl=en&lr=&ie=UTF-8&group=comp.lang.forth.*&scoring=d&selm=Hz8qxE.5K7.1.spenarn%40spenarnc.xs4all.nl&rnum=10
A word looked up by the outer interpreter is either
red (if it is executed immediately) or
blue (if it is compiled).
data pulled in by an executing word is green.
The remainder, denotations or "numbers" are white.
Red \ slash starts comments
Green comments
The closing bracket ) is green
red (  comment starting paren
Red : colon
green word-names follows the colon
blue words follow that
Red ; semi-colon ends the definition
Ref or all control words (IF DO etc,)
Blue/red numbers - those defined as separate words
White most other numbers

The coloring depends on the implementation.
E.g. ciforth has no white words.
In ciforth a number looks like red(1)green(678) , which is similar
to red(')green(DROP) or red(')<SPACE>green(DROP)
-- 
Albert van der Horst,Oranjestr 8,3511 RA UTRECHT,THE NETHERLANDS



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