[comp.lang.forth] Forth as a general purpose language

UNBCIC@BRFAPESP.BITNET (03/29/91)

This is a reply to Bill <bouma@cs.purdue.edu>.

Interesting that I agree with him in many issues, but in others...

The discussion was around types. My point: C & Cia have a way to define
records, arrays and some simple types, such as string, integers and reals.
They have, also, a mechanism similar to the #DEFINE in C. You say that
where the sequence STUDENT is found it should be replaced by RECORD.....

Forth don't have records and arrays nor have strings, and the floating-point
types are not well-known. (There is, for example, the vendors standard for
floating-point, but where I can find the specification, for example?)

*BUT* the CREATE ... DOES> (also known as <BUILDS ... DOES>) mechanism
enable Forth to create whatever type you want. For example, I have a
package written in Forth 83 (probably runs under ANS Forth) by me who
gives to me records, arrays, variant-records and unions. (This package
is based on a records proposal for ANS Forth.)

See, with ALLOT and other words I can create whatever structure I need,
and with DOES> I say how this structure should be manipulated when the
--- a word of this "type" is called. It could, for example, display a
window on the screen an return data aquired through this window. Is that
what, in a previous message, I called "the exactd data type I need".

There is another interesting package, OO4TH21, that provides an complete
interface to object orientation. It can be written in ANS Forth with no
system-depended words (extension wordset words, although).

What I consider a user-defined data type is the abstract data type. This
is provided by object orientation, so, with ANS Forth, I can have true
user-defined data types.

The last point of my message was something about "what you need and can't
find in comercial Forths" (I know I have said HS/Forth... was an example).
I was thinking in what in need that you have in C that you don't have in
comercial Forths.

I know my arguments are ANS Forth-dependents, that is why I support ANS
Forth (the way it is today).

Anyway, I'm not interested in this discussion anymore. I think this message
is pretty clear about what I think. So, don't expect to be answered on this
topic for a while. I'll be hearing (reading) and thinking about for some
time...

                              (8-DCS)
Daniel C. Sobral
UNBCIC@BRFAPESP.BITNET