Level 3, lesson 22

# 3.22 What is not implemented

When writing a product like 4tH that is modelled after an existing programming language like Forth one has to cut a few corners somewhere.

Forth has a fundamentally different architecture, which allows you to extend the compiler with ease. 4tH is much more like conventional programming languages and many still wonder how we got this far.

When you're learning 4tH to learn Forth you will find there are things you can't do in 4tH. This section sums up most of the restrictions 4tH has in comparison to Forth and other languages.

<BUILDS DOES> | There is no way to construct your own datatypes, like you do in Forth. This would make the compiler much more complex. When you are porting a Forth program there is a way around it as you will learn when reading "porting.doc".
Datatypes | There are no words that allow you to define your own datatypes. Structures aren't supported either. However, a good programmer can work his way around as you will see in the next chapter. You won't find any support for mixed, double or unsigned numbers. 4tH uses signed longs, which will do for most purposes.
Floating point | 4tH does not support floating point, but there are several ways to implement fixed point calculation which can do nearly the same job as you will learn in the next chapter.
File handling | 4tH allows you only to have one input file and one output file open at the same time. Both are opened in binary mode, which is usually only relevant when you are working with a Microsoft OS. For most purposes this will do. Equivalents of fseek(), ftell(), setbuf(), etc. are not available.
Interpreter | Since 4tH is a conventional compiler, you won't find a built-in interpreter. There is a library-source, which will enable you to make an interpreter for specific applications with ease. Next chapter we will show you how to use it.
Compiler | You cannot calculate constants at compilation time. You have to use a "literal expression".

If you have more questions concerning the functionality of 4tH, please read the "ansforth.doc" document. This describes the compiliance of 4tH to the ANS-Forth standard. Further information can be obtained by studying "glossary.doc".