mirror of
https://github.com/zeroflag/fcl.git
synced 2025-01-11 20:01:10 +01:00
865 B
865 B
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.
: fib ( n1 n2 -- n1 n2 n3 ) 2dup + ;
: nfib ( n -- .. ) -> n ( local variable )
0 1 { fib } n times ; ( quotation )
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
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"
.