fcl/README.md

29 lines
865 B
Markdown
Raw Normal View History

2021-06-19 20:58:54 +02:00
# FCL - Forth Calculator's Language
FCL is the programming language of an Android app called Forth Calculator. It is a Forth dialect with optional local variables, complex data structures, quotations and Java interoperability.
```forth
: fib ( n1 n2 -- n1 n2 n3 ) 2dup + ;
2021-06-19 20:59:25 +02:00
2021-06-19 21:02:03 +02:00
: nfib ( n -- .. ) -> n ( local variable )
2021-06-19 21:12:23 +02:00
0 1 { fib } n times ; ( quotation )
2021-06-19 20:58:54 +02:00
```
2021-06-19 21:08:32 +02:00
Besides all the high-level features, FCL supports the traditional Forth programming structures and uses the same compilation model (compile/interpret mode, dictionary, immediate words, etc.) as traditional Forth systems.
## The Syntax
2021-06-19 21:22:04 +02:00
The syntax is a superset of the Forth language. In FCL there are literal syntax for creaing Lists `[ 1 2 3 ]`, Maps `#[ 'key' 'value ]#`, Quotations `{ dup + }` and Strings `"Hello World"`.
2021-06-19 21:21:35 +02:00
## Control structures
2021-06-19 21:08:32 +02:00
## Locals
## Maps
## List
2021-06-19 21:21:35 +02:00
## Quotations
2021-06-19 21:08:32 +02:00
## HTTP