- The added line is THIS COLOR.
- The deleted line is THIS COLOR.
[[Documentation]]
*Built-in Features
The currently supported built-in features are integer arithmetics,
floating point number arithmetics, and strings of characters.
Vector arrays will be supported in the near future.
**Lists
The Prolog list syntax is available.
List constructor atoms have three arguments and the name '.'.
***Syntax
X=[A,B|Rest],Rest=[]
is an abbreviated form of '.'(A,Tmp,Rest),'.'(B,Rest,Tmp),'[]'(Rest).
For some reason
the process [A,B|Rest] is parsed as
'.'(A,Tmp), '.'(B,Rest,Tmp).
It should be noted that these two atoms have different arities.
**Numbers
Integer arithmetics and floating point number arithmetics are available.
Note that some features, for example bit-shift operator or cosine function,
are not yet implemented.
Note that atoms are treated as numbers only if
they are unary (i.e., one-argument) atoms.
***Syntax
X = -2, p(345)
X = 2.0, p(-3.14e-10)
***Operations
Currently, the following operations are available:
int(+Float,-Int) - cast
float(+Int,-Float) - cast
'+'(+Int,+Int,-Int) - integer operation, as well as: - * / mod
'+.'(+Float,+Float,-Float) - floating operation, as well as: -. *. /.
**Strings
Strings (such as "abc") are unary atom names and
can be distinguished from symbols (such as 'abc' or just abc).
Note that string literals are treated as strings
only if they are unary;
otherwise, they are treated as symbols.
***Syntax
X = "abc", p("abc\\de\"\nf\
g")
X = "abc", p([[abc\de"
fg]])
The former is in C-like format and the latter is in multiline-quoted format.
The former argument to p is in C-like format
and the latter is in 'multiline-quoted format',
expressing the same string.
Due to this multiline-quoted format,
the literal [[]] expresses an empty string (""),
not a list of empty list ([ []]).
***Operations
Not yet implemented.