Built-in Types
[
Front page
|
List of pages
|
Search
|
Recent changes
|
Backup
|
Help
]
Start:
//[[Documentation]]
*Built-in Types [#c8ed71a5]
The currently supported built-in types are integers,
floating point numbers, and strings.
Some other data types (e.g., arrays) are supported by
library API.
**Numbers [#c5245986]
Integer arithmetics and floating-point number arithmetics...
//Some features, for example bit-shift operator or cosine...
//are not yet implemented.
It is important to note that '''all numbers are unary (i....
other atoms representing larger expressions, data structu...
In order to represent a (multi)set of numbers, the standa...
use a unary atom (san 'n' in the example below) holding e...
***Syntax by examples [#c4ccef48]
X = -2
factorial(10, result)
p(-3.14e-10)
{n(2), n(3), n(5), n(7)}
***Operations [#sb1413f4]
There are two ways of performing arithmetic operations:
++ as explicit rewriting of arithmetic expressions and
++ as operations in the guard of rewrite rules.
Here we describe the first approach that is provided by b...
// int(+Float,-Int) - cast
// float(+Int,-Float) - cast
:'+'(+L,+M,-N)|integer addition, similarly for ''&color(#...
:'+.'(+A,+B,-C)|floating-point addition, similarly for ''...
Arithmetic operations can also be specified in the [[Guar...
**Strings [#g2049983]
Strings (such as "abc") are unary atom names that
are distinguished from ordinary symbols (such as 'abc' or...
String literals are treated as strings
only if they are unary;
otherwise, they are treated as ordinary symbols.
***Syntax by examples [#mbceb06c]
X = "abc"
p("abc\\de\"\nf\
g")
The argument in the second example is in a C-like format.
LMNtal provides another quoted format enclosed by [: and ...
p([:abc\de"
fg:])
This represents an multi-line symbolic atom name rather t...
***Operations [#n29a3450]
Operations on strings are supported by the [[string>Libra...
library API.
End:
//[[Documentation]]
*Built-in Types [#c8ed71a5]
The currently supported built-in types are integers,
floating point numbers, and strings.
Some other data types (e.g., arrays) are supported by
library API.
**Numbers [#c5245986]
Integer arithmetics and floating-point number arithmetics...
//Some features, for example bit-shift operator or cosine...
//are not yet implemented.
It is important to note that '''all numbers are unary (i....
other atoms representing larger expressions, data structu...
In order to represent a (multi)set of numbers, the standa...
use a unary atom (san 'n' in the example below) holding e...
***Syntax by examples [#c4ccef48]
X = -2
factorial(10, result)
p(-3.14e-10)
{n(2), n(3), n(5), n(7)}
***Operations [#sb1413f4]
There are two ways of performing arithmetic operations:
++ as explicit rewriting of arithmetic expressions and
++ as operations in the guard of rewrite rules.
Here we describe the first approach that is provided by b...
// int(+Float,-Int) - cast
// float(+Int,-Float) - cast
:'+'(+L,+M,-N)|integer addition, similarly for ''&color(#...
:'+.'(+A,+B,-C)|floating-point addition, similarly for ''...
Arithmetic operations can also be specified in the [[Guar...
**Strings [#g2049983]
Strings (such as "abc") are unary atom names that
are distinguished from ordinary symbols (such as 'abc' or...
String literals are treated as strings
only if they are unary;
otherwise, they are treated as ordinary symbols.
***Syntax by examples [#mbceb06c]
X = "abc"
p("abc\\de\"\nf\
g")
The argument in the second example is in a C-like format.
LMNtal provides another quoted format enclosed by [: and ...
p([:abc\de"
fg:])
This represents an multi-line symbolic atom name rather t...
***Operations [#n29a3450]
Operations on strings are supported by the [[string>Libra...
library API.
Page: