359 Reserved Words and No Syntax 
Author Message
 359 Reserved Words and No Syntax

        359 Reserved Words and No Syntax

"Standard Forth has 359 reserved words and no syntax but succession."

Both parts of that sentence are false.  There's nothing in Forth to
stop you from changing any of the 359 words.  This in general is not
a good idea, so the first part of the sentence is _close_ to true.

The second part of the sentence is true for most of the 359 words, but
there are special syntactic forms for a few.  These are given in the
Standard as parsing text.  And you have the privilege of making new
syntactic rules for the words you define.  Furthermore the syntactic
rules are not context free.

For instance, the syntaxes for `CONSTANT` and for `CHAR` are different
inside and outside a definition.

Of the 359 words, 133 are required.  These are the ones in the Core
word set.  There are another 46 words in the Core Extension word set.
6 of these (and another elsewhere) are flagged as "obsolescent".

The words in the Core Extension word set are losers.  They are words
that were proposed for the Core word set and didn't make it.

The required words include `<`, `=`, and `>`.  The required words
include `0<` and `0=` but not `0>`.  That's in the Core Extension
word set.  `U<` is required but not `U>`, which is in the Core
Extension word set.

The full system has `D0<` and `D0=`, `D<` and `D=`, but not
`D0>`  or `D>`.  The system has `CHAR+` and `CELL+` but no
`CHAR-` or `CELL-`.  Although the Core Extension has `NIP` and
`TUCK` it doesn't have `-ROT`.  `\`, which is so popular here,
is not required.

`OFF`, `ON`, `<=`, and `>=` were proposed and rejected.

What does this tell me?

It tells me that the world that is making money from Forth doesn't
need these words.

My Forth working set is larger than the Core and Core Extension
word set.  But that's for the work that I do with Forth.  It is
still all compilable from the Standard.  The Forths that I use
all have the top of stack in a register.  Thus `SWAP` is three
machine instructions, `DROP` is two machine instructions, and
`NIP` is one machine instruction.  So I want `NIP` for
compilation and clarity as I see it.

I still build my pet words carefully from the Standard words.
--
Procedamus in pace.    Wil Baden   Costa Mesa, California



Tue, 28 Dec 1999 03:00:00 GMT  
 359 Reserved Words and No Syntax


Quote:
>        359 Reserved Words and No Syntax
>"Standard Forth has 359 reserved words and no syntax but succession."
>Both parts of that sentence are false.  There's nothing in Forth to
>stop you from changing any of the 359 words.  This in general is not
>a good idea, so the first part of the sentence is _close_ to true.

I agree with you entirely here, but not for your reasons.

Quote:
>The second part of the sentence is true for most of the 359 words, but
>there are special syntactic forms for a few.  These are given in the
>Standard as parsing text.  And you have the privilege of making new
>syntactic rules for the words you define.  Furthermore the syntactic
>rules are not context free.

There's a minor quibble, of course, on whether those syntactic forms
are part of Forth or part of the words in which they occur.  I would
argue that they are part of the word itself; Forth does nothing
whatsoever to enforce them.

However, having noted that I must concede that the syntax might as
well be part of Forth (although I would dread to teach it that way,
since each word handles it differently).

The syntactic feature which actually seems most noticible to me as
part of Forth proper is numbers.  Numbers, sequence, and delimiters
are the only things which are actually managed by Forth's parser.

Quote:
>For instance, the syntaxes for `CONSTANT` and for `CHAR` are different
>inside and outside a definition.

/* The syntax for printf is different inside a #define -- or is it? */
#define print  printf

I would tend to disagree.

Quote:
>Procedamus in pace.    Wil Baden   Costa Mesa, California

-Billy


Fri, 31 Dec 1999 03:00:00 GMT  
 359 Reserved Words and No Syntax

: I would tend to disagree.

Thanks for your note.  

How do the rest of you think?
--
Wil



Sat, 01 Jan 2000 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. How the Rich Got That Way 359

2. INFO-ADA Digest V93 #359

3. Problem with reserved words in column names.

4. Reserved words in JCL

5. PB 3.5 Reserved Words List?

6. Obtaining a list of Clarion Reserved Words

7. Reserved word ?

8. CW4 - Reserved Words

9. xbase to clarion with reserved word as xbase variable

10. Reserved Words (2)

11. Reserved words

 

 
Powered by phpBB® Forum Software